Пример #1
0
 /**
  * @param $PortionData
  * @param $CompleteData
  * @return array|Exception
  */
 public static function Insert($PortionData, $CompleteData)
 {
     try {
         // Validate first
         self::Validate($PortionData);
         $Entry = ['observation' => ['@attributes' => ['classCode' => 'OBS', 'moodCode' => 'EVN'], 'templateId' => Component::templateId('2.16.840.1.113883.10.20.22.4.127'), 'id' => Component::id(Utilities::UUIDv4()), 'code' => ['@attributes' => ['code' => $PortionData['code'], 'codeSystem' => Utilities::CodingSystemId($PortionData['codeSystemName']), 'codeSystemName' => $PortionData['codeSystemName'], 'displayName' => $PortionData['displayName']]], 'statusCode' => Component::statusCode('completed'), 'effectiveTime' => Component::time($PortionData['effectiveTime']), 'value' => ['@attributes' => ['xsi:type' => 'CD', 'code' => $PortionData['mentalCode'], 'codeSystem' => Utilities::CodingSystemId($PortionData['mentalCodeSystemName']), 'codeSystemName' => $PortionData['mentalCodeSystemName'], 'displayName' => $PortionData['mentalDisplayName']]]]];
         // MAY contain zero or one [0..1] entryRelationship
         // SHALL contain exactly one [1..1] Assessment Scale Observation
         if (count($PortionData['AssessmentScaleObservation']) > 0) {
             foreach ($PortionData['AssessmentScaleObservation'] as $AssessmentScaleObservation) {
                 $Entry['observation']['entryRelationship'][] = ['@attributes' => ['typeCode' => 'COMP'], assessmentScaleObservation::Insert($AssessmentScaleObservation, $CompleteData)];
             }
         }
         return $Entry;
     } catch (Exception $Error) {
         return $Error;
     }
 }
Пример #2
0
 /**
  * @param $PortionData
  * @param $CompleteData
  * @return array|Exception
  */
 public static function Insert($PortionData, $CompleteData)
 {
     try {
         // Validate first
         self::Validate($PortionData);
         $Entry = ['observation' => ['@attributes' => ['classCode' => 'OBS', 'moodCode' => 'EVN'], 'templateId' => Component::templateId('2.16.840.1.113883.10.20.22.4.67.2'), 'id' => Component::id(Utilities::UUIDv4()), 'code' => ['@attributes' => ['code' => '364644000', 'codeSystem' => '2.16.840.1.113883.6.96', 'displayName' => 'functional observable', 'codeSystemName' => 'SNOMED CT']], 'text' => self::Narrative($PortionData), 'statusCode' => Component::statusCode('completed'), 'effectiveTime' => Component::time($PortionData['effectiveTime']), 'value' => ['@attributes' => ['xsi:type' => 'CD', 'code' => $PortionData['physicalFunctionCode'], 'displayName' => $PortionData['physicalFunctionDisplayName'], 'codeSystem' => Utilities::CodingSystemId($PortionData['physicalFunctionCodeSystemName']), 'codeSystemName' => $PortionData['physicalFunctionCodeSystemName']]]]];
         // MAY contain zero or one [0..1] entryRelationship (CONF:8675)
         // SHALL contain exactly one [1..1] Age Observation
         if (count($PortionData['Authors']) > 0) {
             foreach ($PortionData['Authors'] as $Author) {
                 $Entry['observation']['author'][] = LevelDocument\author::Insert($Author);
             }
         }
         // MAY contain zero or one [0..1] entryRelationship (CONF:13892)
         // SHALL contain exactly one [1..1] Non-Medicinal Supply Activity (V2)
         if (count($PortionData['NonMedicinalSupplyActivity']) > 0) {
             foreach ($PortionData['NonMedicinalSupplyActivity'] as $NonMedicinalSupplyActivity) {
                 $Entry['observation']['entryRelationship'][] = ['@attributes' => ['typeCode' => 'REFR'], 'observation' => nonMedicinalSupplyActivity::Insert($NonMedicinalSupplyActivity, $CompleteData)];
             }
         }
         // MAY contain zero or one [0..1] entryRelationship (CONF:13895)
         // SHALL contain exactly one [1..1] Caregiver Characteristics
         if (count($PortionData['CaregiverCharacteristics']) > 0) {
             foreach ($PortionData['CaregiverCharacteristics'] as $CaregiverCharacteristics) {
                 $Entry['observation']['entryRelationship'][] = ['@attributes' => ['typeCode' => 'REFR'], 'observation' => caregiverCharacteristics::Insert($CaregiverCharacteristics, $CompleteData)];
             }
         }
         // MAY contain zero or one [0..1] entryRelationship (CONF:14465)
         // SHALL contain exactly one [1..1] Assessment Scale Observation
         if (count($PortionData['AssessmentScaleObservation']) > 0) {
             foreach ($PortionData['AssessmentScaleObservation'] as $AssessmentScaleObservation) {
                 $Entry['observation']['entryRelationship'][] = ['@attributes' => ['typeCode' => 'COMP'], 'observation' => assessmentScaleObservation::Insert($AssessmentScaleObservation, $CompleteData)];
             }
         }
         return $Entry;
     } catch (Exception $Error) {
         return $Error;
     }
 }
Пример #3
0
 /**
  * @param $PortionData
  * @param $CompleteData
  * @return array|Exception
  */
 public static function Insert($PortionData, $CompleteData)
 {
     try {
         // Validate first
         self::Validate($PortionData);
         $Entry = ['observation' => ['@attributes' => ['classCode' => 'OBS', 'moodCode' => 'EVN'], 'templateId' => Component::templateId('2.16.840.1.113883.10.20.22.4.74.2'), 'id' => Component::id(Utilities::UUIDv4()), 'code' => ['@attributes' => ['code' => '311465003', 'codeSystem' => '2.16.840.1.113883.6.96', 'codeSystemName' => 'SNOED-CT', 'displayName' => 'Cognitive functions']], 'effectiveTime' => Component::time($PortionData['effectiveTime']), 'value' => ['xsi:type' => 'CD', 'code' => $PortionData['code'], 'displayName' => $PortionData['displayName'], 'codeSystem' => Utilities::CodingSystemId($PortionData['codeSystemName']), 'codeSystemName' => $PortionData['codeSystemName']]]];
         // SHOULD contain zero or more [0..*] Author Participation (NEW)
         if (count($PortionData['Authors']) > 0) {
             foreach ($PortionData['Authors'] as $Author) {
                 $Entry['observation']['author'][] = LevelOther\authorParticipation::Insert($Author, $CompleteData);
             }
         }
         // MAY contain zero or more [0..*] entryRelationship (CONF:14272) such that it
         // SHALL contain exactly one [1..1] Non-Medicinal Supply Activity (V2)
         if (count($PortionData['NonMedicinalSupplyActivity']) > 0) {
             $Entry['observation']['entryRelationship'][] = nonMedicinalSupplyActivity::Insert($PortionData['NonMedicinalSupplyActivity'], $CompleteData);
         }
         // MAY contain zero or more [0..*] entryRelationship (CONF:14272) such that it
         // SHALL contain exactly one [1..1] Caregiver Characteristics
         if (count($PortionData['CaregiverCharacteristics']) > 0) {
             $Entry['observation']['entryRelationship'][] = caregiverCharacteristics::Insert($PortionData['CaregiverCharacteristics'], $CompleteData);
         }
         // MAY contain zero or more [0..*] entryRelationship (CONF:14272) such that it
         // b.	SHALL contain exactly one [1..1] Assessment Scale Observation
         if (count($PortionData['AssessmentScaleObservation']) > 0) {
             $Entry['observation']['entryRelationship'][] = assessmentScaleObservation::Insert($PortionData['AssessmentScaleObservation'], $CompleteData);
         }
         return $Entry;
     } catch (Exception $Error) {
         return $Error;
     }
 }
Пример #4
0
 /**
  * @param $PortionData
  * @param $CompleteData
  * @return array|Exception
  */
 public static function Insert($PortionData, $CompleteData)
 {
     try {
         // Validate first
         self::Validate($PortionData);
         $Section = ['component' => ['section' => ['templateId' => ['@attributes' => ['root' => '2.16.840.1.113883.10.20.22.2.14.2']], 'code' => ['@attributes' => ['code' => '47420-5', 'displayName' => 'Functional Status', 'codeSystem' => '2.16.840.1.113883.6.1', 'codeSystemName' => 'LOINC']], 'title' => 'Functional Status', 'text' => self::Narrative($PortionData)]]];
         // SHOULD contain zero or more [0..*] entry
         // SHALL contain exactly one [1..1] Functional Status Organizer (V2)
         if (count($PortionData['FunctionalStatusOrganizer']) > 0) {
             foreach ($PortionData['FunctionalStatusOrganizer'] as $FunctionalStatusOrganizer) {
                 $Section['component']['section']['entry'][] = LevelEntry\functionalStatusOrganizer::Insert($FunctionalStatusOrganizer, $CompleteData);
             }
         }
         // SHOULD contain zero or more [0..*] entry
         // SHALL contain exactly one [1..1] Functional Status Observation (V2)
         if (count($PortionData['FunctionalStatusObservation']) > 0) {
             foreach ($PortionData['FunctionalStatusObservation'] as $FunctionalStatusObservation) {
                 $Section['component']['section']['entry'][] = LevelEntry\functionalStatusObservation::Insert($FunctionalStatusObservation, $CompleteData);
             }
         }
         // SHOULD contain zero or more [0..*] entry
         // SHALL contain exactly one [1..1] Caregiver Characteristics
         if (count($PortionData['CaregiverCharacteristics']) > 0) {
             foreach ($PortionData['CaregiverCharacteristics'] as $CaregiverCharacteristics) {
                 $Section['component']['section']['entry'][] = LevelEntry\caregiverCharacteristics::Insert($CaregiverCharacteristics, $CompleteData);
             }
         }
         // SHOULD contain zero or more [0..*] entry
         // SHALL contain exactly one [1..1] Assessment Scale Observation
         if (count($PortionData['AssessmentScaleObservation']) > 0) {
             foreach ($PortionData['AssessmentScaleObservation'] as $AssessmentScaleObservation) {
                 $Section['component']['section']['entry'][] = LevelEntry\assessmentScaleObservation::Insert($AssessmentScaleObservation, $CompleteData);
             }
         }
         // SHOULD contain zero or more [0..*] entry
         // SHALL contain exactly one [1..1] Non-Medicinal Supply Activity (V2)
         if (count($PortionData['NonMedicinalSupplyActivity']) > 0) {
             foreach ($PortionData['AssessmentScaleObservation'] as $NonMedicinalSupplyActivity) {
                 $Section['component']['section']['entry'][] = LevelEntry\nonMedicinalSupplyActivity::Insert($NonMedicinalSupplyActivity, $CompleteData);
             }
         }
         // SHOULD contain zero or more [0..*] entry
         // SHALL contain exactly one [1..1] Self-Care Activities (ADL and IADL) (NEW)
         if (count($PortionData['SelfCareActivitiesADLAndIADL']) > 0) {
             foreach ($PortionData['SelfCareActivitiesADLAndIADL'] as $SelfCareActivitiesADLAndIADL) {
                 $Section['component']['section']['entry'][] = LevelEntry\selfCareActivitiesADLAndIADL::Insert($SelfCareActivitiesADLAndIADL, $CompleteData);
             }
         }
         // SHOULD contain zero or more [0..*] entry
         // SHALL contain exactly one [1..1] Sensory and Speech Status (NEW)
         if (count($PortionData['SensoryAndSpeechStatus']) > 0) {
             foreach ($PortionData['SensoryAndSpeechStatus'] as $SensoryAndSpeechStatus) {
                 $Section['component']['section']['entry'][] = LevelEntry\sensoryAndSpeechStatus::Insert($SensoryAndSpeechStatus, $CompleteData);
             }
         }
         return $Section;
     } catch (Exception $Error) {
         return $Error;
     }
 }
Пример #5
0
 /**
  * @param $PortionData
  * @param $CompleteData
  * @return array|Exception
  */
 public static function Insert($PortionData, $CompleteData)
 {
     try {
         // Validate first
         self::Validate($PortionData);
         $Entry = ['act' => ['@attributes' => ['classCode' => 'ACT', 'moodCode' => 'EVN'], 'templateId' => Component::templateId('2.16.840.1.113883.10.20.22.4.132'), 'id' => Component::id(Utilities::UUIDv4()), 'code' => ['@attributes' => ['code' => 'CONC', 'displayName' => 'handoff communication (procedure)', 'codeSystem' => '2.16.840.1.113883.5.6', 'codeSystemName' => 'HL7ActClass', 'displayName' => 'Concern']], 'statusCode' => Component::statusCode('active'), 'effectiveTime' => Component::time($PortionData['effectiveTime'])]];
         // SHOULD contain zero or more [0..*] Author Participation (NEW)
         if (count($PortionData['Author']) > 0) {
             foreach ($PortionData['Author'] as $Author) {
                 $Entry['act']['author'][] = LevelOther\authorParticipation::Insert($Author, $CompleteData);
             }
         }
         // MAY contain zero or more [0..*] entryRelationship
         // SHALL contain exactly one [1..1] Problem Observation (V2)
         if (count($PortionData['ProblemObservation']) > 0) {
             foreach ($PortionData['ProblemObservation'] as $ProblemObservation) {
                 $Entry['act']['entryRelationship'][] = ['@attributes' => ['typeCode' => 'REFR'], problemObservation::Insert($ProblemObservation, $CompleteData)];
             }
         }
         // MAY contain zero or more [0..*] entryRelationship
         // SHALL contain exactly one [1..1] Allergy - Intolerance Observation (V2)
         if (count($PortionData['AllergyIntoleranceObservation']) > 0) {
             foreach ($PortionData['AllergyIntoleranceObservation'] as $AllergyIntoleranceObservation) {
                 $Entry['act']['entryRelationship'][] = ['@attributes' => ['typeCode' => 'REFR'], allergyIntoleranceObservation::Insert($AllergyIntoleranceObservation, $CompleteData)];
             }
         }
         // MAY contain zero or more [0..*] entryRelationship
         // SHALL contain exactly one [1..1] Assessment Scale Observation
         if (count($PortionData['AssessmentScaleObservation']) > 0) {
             foreach ($PortionData['AssessmentScaleObservation'] as $AssessmentScaleObservation) {
                 $Entry['act']['entryRelationship'][] = ['@attributes' => ['typeCode' => 'REFR'], assessmentScaleObservation::Insert($AssessmentScaleObservation, $CompleteData)];
             }
         }
         // MAY contain zero or more [0..*] entryRelationship
         // SHALL contain exactly one [1..1] Self-Care Activities (ADL and IADL) (NEW)
         if (count($PortionData['SelfCareActivitiesADLAndIADL']) > 0) {
             foreach ($PortionData['SelfCareActivitiesADLAndIADL'] as $SelfCareActivitiesADLAndIADL) {
                 $Entry['act']['entryRelationship'][] = ['@attributes' => ['typeCode' => 'REFR'], selfCareActivitiesADLAndIADL::Insert($SelfCareActivitiesADLAndIADL, $CompleteData)];
             }
         }
         // MAY contain zero or more [0..*] entryRelationship
         // SHALL contain exactly one [1..1] Cognitive Abilities Observation (NEW)
         if (count($PortionData['CognitiveAbilitiesObservation']) > 0) {
             foreach ($PortionData['CognitiveAbilitiesObservation'] as $CognitiveAbilitiesObservation) {
                 $Entry['act']['entryRelationship'][] = ['@attributes' => ['typeCode' => 'REFR'], cognitiveAbilitiesObservation::Insert($CognitiveAbilitiesObservation, $CompleteData)];
             }
         }
         // MAY contain zero or more [0..*] entryRelationship
         // SHALL contain exactly one [1..1] Cognitive Status Observation (V2)
         if (count($PortionData['CognitiveStatusObservation']) > 0) {
             foreach ($PortionData['CognitiveStatusObservation'] as $CognitiveStatusObservation) {
                 $Entry['act']['entryRelationship'][] = ['@attributes' => ['typeCode' => 'REFR'], cognitiveStatusObservation::Insert($CognitiveStatusObservation, $CompleteData)];
             }
         }
         // MAY contain zero or more [0..*] entryRelationship
         // SHALL contain exactly one [1..1] Cognitive Status Observation (V2)
         if (count($PortionData['CurrentSmokingStatus']) > 0) {
             foreach ($PortionData['CurrentSmokingStatus'] as $CurrentSmokingStatus) {
                 $Entry['entryRelationship'][] = ['@attributes' => ['typeCode' => 'REFR'], 'observation' => currentSmokingStatus::Insert($CurrentSmokingStatus, $CompleteData)];
             }
         }
         // MAY contain zero or more [0..*] entryRelationship
         // SHALL contain exactly one [1..1] Encounter Diagnosis (V2)
         if (count($PortionData['EncounterDiagnosis']) > 0) {
             foreach ($PortionData['EncounterDiagnosis'] as $EncounterDiagnosis) {
                 $Entry['act']['entryRelationship'][] = ['@attributes' => ['typeCode' => 'REFR'], encounterDiagnosis::Insert($EncounterDiagnosis, $CompleteData)];
             }
         }
         // MAY contain zero or more [0..*] entryRelationship
         // SHALL contain exactly one [1..1] Family History Organizer
         if (count($PortionData['FamilyHistoryOrganizer']) > 0) {
             foreach ($PortionData['FamilyHistoryOrganizer'] as $FamilyHistoryOrganizer) {
                 $Entry['act']['entryRelationship'][] = ['@attributes' => ['typeCode' => 'REFR'], familyHistoryOrganizer::Insert($FamilyHistoryOrganizer, $CompleteData)];
             }
         }
         // MAY contain zero or more [0..*] entryRelationship
         // SHALL contain exactly one [1..1] Functional Status Observation (V2)
         if (count($PortionData['FunctionalStatusObservation']) > 0) {
             foreach ($PortionData['FunctionalStatusObservation'] as $FunctionalStatusObservation) {
                 $Entry['act']['entryRelationship'][] = ['@attributes' => ['typeCode' => 'REFR'], functionalStatusObservation::Insert($FunctionalStatusObservation, $CompleteData)];
             }
         }
         // MAY contain zero or more [0..*] entryRelationship
         // SHALL contain exactly one [1..1] Hospital Admission Diagnosis (V2)
         if (count($PortionData['HospitalAdmissionDiagnosis']) > 0) {
             foreach ($PortionData['HospitalAdmissionDiagnosis'] as $HospitalAdmissionDiagnosis) {
                 $Entry['act']['entryRelationship'][] = ['@attributes' => ['typeCode' => 'REFR'], hospitalAdmissionDiagnosis::Insert($HospitalAdmissionDiagnosis, $CompleteData)];
             }
         }
         // MAY contain zero or more [0..*] entryRelationship
         // SHALL contain exactly one [1..1] Mental Status Observation (NEW)
         if (count($PortionData['MentalStatusObservation']) > 0) {
             foreach ($PortionData['MentalStatusObservation'] as $MentalStatusObservation) {
                 $Entry['act']['entryRelationship'][] = ['@attributes' => ['typeCode' => 'REFR'], mentalStatusObservation::Insert($MentalStatusObservation, $CompleteData)];
             }
         }
         // MAY contain zero or more [0..*] entryRelationship
         // SHALL contain exactly one [1..1] Nutrition Assessment (NEW)
         if (count($PortionData['NutritionAssessment']) > 0) {
             foreach ($PortionData['NutritionAssessment'] as $NutritionAssessment) {
                 $Entry['act']['entryRelationship'][] = ['@attributes' => ['typeCode' => 'REFR'], nutritionAssessment::Insert($NutritionAssessment, $CompleteData)];
             }
         }
         // MAY contain zero or more [0..*] entryRelationship
         // SHALL contain exactly one [1..1] Nutrition Assessment (NEW)
         if (count($PortionData['PostprocedureDiagnosis']) > 0) {
             foreach ($PortionData['PostprocedureDiagnosis'] as $PostprocedureDiagnosis) {
                 $Entry['act']['entryRelationship'][] = ['@attributes' => ['typeCode' => 'REFR'], postprocedureDiagnosis::Insert($PostprocedureDiagnosis, $CompleteData)];
             }
         }
         // MAY contain zero or more [0..*] entryRelationship
         // SHALL contain exactly one [1..1] Pregnancy Observation
         if (count($PortionData['PregnancyObservation']) > 0) {
             foreach ($PortionData['PregnancyObservation'] as $PregnancyObservation) {
                 $Entry['act']['entryRelationship'][] = ['@attributes' => ['typeCode' => 'REFR'], pregnancyObservation::Insert($PregnancyObservation, $CompleteData)];
             }
         }
         // MAY contain zero or more [0..*] entryRelationship
         // SHALL contain exactly one [1..1] Preoperative Diagnosis (V2)
         if (count($PortionData['PreoperativeDiagnosis']) > 0) {
             foreach ($PortionData['PreoperativeDiagnosis'] as $PreoperativeDiagnosis) {
                 $Entry['act']['entryRelationship'][] = ['@attributes' => ['typeCode' => 'REFR'], preoperativeDiagnosis::Insert($PreoperativeDiagnosis, $CompleteData)];
             }
         }
         // MAY contain zero or more [0..*] entryRelationship
         // SHALL contain exactly one [1..1] Reaction Observation (V2)
         if (count($PortionData['ReactionObservation']) > 0) {
             foreach ($PortionData['ReactionObservation'] as $ReactionObservation) {
                 $Entry['act']['entryRelationship'][] = ['@attributes' => ['typeCode' => 'REFR'], reactionObservation::Insert($ReactionObservation, $CompleteData)];
             }
         }
         // MAY contain zero or more [0..*] entryRelationship
         // SHALL contain exactly one [1..1] Reaction Observation (V2)
         if (count($PortionData['ResultObservation']) > 0) {
             foreach ($PortionData['ResultObservation'] as $ResultObservation) {
                 $Entry['act']['entryRelationship'][] = ['@attributes' => ['typeCode' => 'REFR'], resultObservation::Insert($ResultObservation, $CompleteData)];
             }
         }
         // MAY contain zero or more [0..*] entryRelationship
         // SHALL contain exactly one [1..1] Sensory and Speech Status (NEW)
         if (count($PortionData['SensoryAndSpeechStatus']) > 0) {
             foreach ($PortionData['SensoryAndSpeechStatus'] as $SensoryAndSpeechStatus) {
                 $Entry['act']['entryRelationship'][] = ['@attributes' => ['typeCode' => 'REFR'], sensoryAndSpeechStatus::Insert($SensoryAndSpeechStatus, $CompleteData)];
             }
         }
         // MAY contain zero or more [0..*] entryRelationship
         // SHALL contain exactly one [1..1] Social History Observation (V2)
         if (count($PortionData['SocialHistoryObservation']) > 0) {
             foreach ($PortionData['SocialHistoryObservation'] as $SocialHistoryObservation) {
                 $Entry['act']['entryRelationship'][] = ['@attributes' => ['typeCode' => 'REFR'], socialHistoryObservation::Insert($SocialHistoryObservation, $CompleteData)];
             }
         }
         // MAY contain zero or more [0..*] entryRelationship
         // SHALL contain exactly one [1..1] Substance or Device Allergy - Intolerance Observation (V2)
         if (count($PortionData['SubstanceOrDeviceAllergyIntoleranceObservation']) > 0) {
             foreach ($PortionData['SubstanceOrDeviceAllergyIntoleranceObservation'] as $SubstanceOrDeviceAllergyIntoleranceObservation) {
                 $Entry['act']['entryRelationship'][] = ['@attributes' => ['typeCode' => 'REFR'], substanceOrDeviceAllergyIntoleranceObservation::Insert($SubstanceOrDeviceAllergyIntoleranceObservation, $CompleteData)];
             }
         }
         // MAY contain zero or more [0..*] entryRelationship
         // SHALL contain exactly one [1..1] Tobacco Use (V2)
         if (count($PortionData['TobaccoUse']) > 0) {
             foreach ($PortionData['TobaccoUse'] as $TobaccoUse) {
                 $Entry['act']['entryRelationship'][] = ['@attributes' => ['typeCode' => 'REFR'], tobaccoUse::Insert($TobaccoUse, $CompleteData)];
             }
         }
         // MAY contain zero or more [0..*] entryRelationship
         // SHALL contain exactly one [1..1] Vital Sign Observation (V2)
         if (count($PortionData['VitalSignObservation']) > 0) {
             foreach ($PortionData['VitalSignObservation'] as $VitalSignObservation) {
                 $Entry['act']['entryRelationship'][] = ['@attributes' => ['typeCode' => 'REFR'], vitalSignObservation::Insert($VitalSignObservation, $CompleteData)];
             }
         }
         // MAY contain zero or more [0..*] entryRelationship
         // SHALL contain exactly one [1..1] Wound Observation (NEW)
         if (count($PortionData['WoundObservation']) > 0) {
             foreach ($PortionData['WoundObservation'] as $WoundObservation) {
                 $Entry['act']['entryRelationship'][] = ['@attributes' => ['typeCode' => 'REFR'], woundObservation::Insert($WoundObservation, $CompleteData)];
             }
         }
         // MAY contain zero or more [0..*] entryRelationship
         // SHALL contain exactly one [1..1] Caregiver Characteristics
         if (count($PortionData['CaregiverCharacteristics']) > 0) {
             foreach ($PortionData['CaregiverCharacteristics'] as $CaregiverCharacteristics) {
                 $Entry['act']['entryRelationship'][] = ['@attributes' => ['typeCode' => 'REFR'], caregiverCharacteristics::Insert($CaregiverCharacteristics, $CompleteData)];
             }
         }
         // MAY contain zero or more [0..*] entryRelationship
         // SHALL contain exactly one [1..1] Cultural and Religious Observation (NEW)
         if (count($PortionData['CulturalAndReligiousObservation']) > 0) {
             foreach ($PortionData['CulturalAndReligiousObservation'] as $CulturalAndReligiousObservation) {
                 $Entry['act']['entryRelationship'][] = ['@attributes' => ['typeCode' => 'REFR'], culturalAndReligiousObservation::Insert($CulturalAndReligiousObservation, $CompleteData)];
             }
         }
         // MAY contain zero or more [0..*] entryRelationship
         // SHALL contain exactly one [1..1] Characteristics of Home Environment (NEW)
         if (count($PortionData['CharacteristicsOfHomeEnvironment']) > 0) {
             foreach ($PortionData['CharacteristicsOfHomeEnvironment'] as $CharacteristicsOfHomeEnvironment) {
                 $Entry['act']['entryRelationship'][] = ['@attributes' => ['typeCode' => 'REFR'], characteristicsOfHomeEnvironment::Insert($CharacteristicsOfHomeEnvironment, $CompleteData)];
             }
         }
         // MAY contain zero or more [0..*] entryRelationship
         // SHALL contain exactly one [1..1] Nutritional Status Observation (NEW)
         if (count($PortionData['NutritionalStatusObservation']) > 0) {
             foreach ($PortionData['NutritionalStatusObservation'] as $NutritionalStatusObservation) {
                 $Entry['act']['entryRelationship'][] = ['@attributes' => ['typeCode' => 'REFR'], nutritionalStatusObservation::Insert($NutritionalStatusObservation, $CompleteData)];
             }
         }
         // MAY contain zero or more [0..*] entryRelationship
         // SHALL contain exactly one [1..1] Result Organizer (V2)
         if (count($PortionData['ResultOrganizer']) > 0) {
             foreach ($PortionData['ResultOrganizer'] as $ResultOrganizer) {
                 $Entry['act']['entryRelationship'][] = ['@attributes' => ['typeCode' => 'REFR'], resultOrganizer::Insert($ResultOrganizer, $CompleteData)];
             }
         }
         // MAY contain zero or more [0..*] entryRelationship
         // SHALL contain exactly one [1..1] Patient Priority Preference (NEW)
         if (count($PortionData['PatientPriorityPreference']) > 0) {
             foreach ($PortionData['PatientPriorityPreference'] as $PatientPriorityPreference) {
                 $Entry['act']['entryRelationship'][] = ['@attributes' => ['typeCode' => 'REFR'], patientPriorityPreference::Insert($PatientPriorityPreference, $CompleteData)];
             }
         }
         // MAY contain zero or more [0..*] entryRelationship
         // SHALL contain exactly one [1..1] Provider Priority Preference (NEW)
         if (count($PortionData['ProviderPriorityPreference']) > 0) {
             foreach ($PortionData['ProviderPriorityPreference'] as $ProviderPriorityPreference) {
                 $Entry['act']['entryRelationship'][] = ['@attributes' => ['typeCode' => 'REFR'], providerPriorityPreference::Insert($ProviderPriorityPreference, $CompleteData)];
             }
         }
         // MAY contain zero or more [0..*] entryRelationship
         // SHALL contain exactly one [1..1] Problem Concern Act (Condition) (V2)
         if (count($PortionData['ProblemConcernActCondition']) > 0) {
             foreach ($PortionData['ProblemConcernActCondition'] as $ProblemConcernActCondition) {
                 $Entry['act']['entryRelationship'][] = ['@attributes' => ['typeCode' => 'REFR'], problemConcernActCondition::Insert($ProblemConcernActCondition, $CompleteData)];
             }
         }
         // MAY contain zero or more [0..*] entryRelationship
         // SHALL contain exactly one [1..1] Act Reference (NEW)
         if (count($PortionData['ActReference']) > 0) {
             foreach ($PortionData['ActReference'] as $ActReference) {
                 $Entry['act']['entryRelationship'][] = ['@attributes' => ['typeCode' => 'REFR'], actReference::Insert($ActReference, $CompleteData)];
             }
         }
         return $Entry;
     } catch (Exception $Error) {
         return $Error;
     }
 }
Пример #6
0
 /**
  * @param $PortionData
  * @param $CompleteData
  * @return array|Exception
  */
 public static function Insert($PortionData, $CompleteData)
 {
     try {
         // Validate first
         self::Validate($PortionData);
         $Section = ['component' => ['section' => ['templateId' => Component::templateId('2.16.840.1.113883.10.20.22.2.14'), 'code' => ['@attributes' => ['code' => '10190-7', 'codeSystem' => '2.16.840.1.113883.6.1', 'codeSystemName' => 'LOINC', 'displayName' => 'Mental Status']], 'title' => 'Mental Status', 'text' => self::Narrative($PortionData)]]];
         // SHOULD contain zero or more [0..*] entry
         // SHALL contain exactly one [1..1] Cognitive Status Organizer (V2)
         if (count($PortionData['CognitiveStatusOrganizer']) > 0) {
             foreach ($PortionData['CognitiveStatusOrganizer'] as $CognitiveStatusOrganizer) {
                 $Section['component']['section']['entry'][] = LevelEntry\cognitiveStatusOrganizer::Insert($CognitiveStatusOrganizer, $CompleteData);
             }
         }
         // SHOULD contain zero or more [0..*] entry
         // SHALL contain exactly one [1..1] Cognitive Status Observation (V2)
         if (count($PortionData['CognitiveStatusObservation']) > 0) {
             foreach ($PortionData['CognitiveStatusObservation'] as $CognitiveStatusObservation) {
                 $Section['component']['section']['entry'][] = LevelEntry\cognitiveStatusObservation::Insert($CognitiveStatusObservation, $CompleteData);
             }
         }
         // SHOULD contain zero or more [0..*] entry
         // SHALL contain exactly one [1..1] Caregiver Characteristics
         if (count($PortionData['CaregiverCharacteristics']) > 0) {
             foreach ($PortionData['CaregiverCharacteristics'] as $CaregiverCharacteristics) {
                 $Section['component']['section']['entry'][] = LevelEntry\caregiverCharacteristics::Insert($CaregiverCharacteristics, $CompleteData);
             }
         }
         // SHOULD contain zero or more [0..*] entry
         // SHALL contain exactly one [1..1] Assessment Scale Observation
         if (count($PortionData['AssessmentScaleObservation']) > 0) {
             foreach ($PortionData['AssessmentScaleObservation'] as $AssessmentScaleObservation) {
                 $Section['component']['section']['entry'][] = LevelEntry\assessmentScaleObservation::Insert($AssessmentScaleObservation, $CompleteData);
             }
         }
         // SHOULD contain zero or more [0..*] entry
         // SHALL contain exactly one [1..1] Non-Medicinal Supply Activity (V2)
         if (count($PortionData['NonMedicinalSupplyActivity']) > 0) {
             foreach ($PortionData['NonMedicinalSupplyActivity'] as $NonMedicinalSupplyActivity) {
                 $Section['component']['section']['entry'][] = LevelEntry\nonMedicinalSupplyActivity::Insert($NonMedicinalSupplyActivity, $CompleteData);
             }
         }
         // SHOULD contain zero or more [0..*] entry
         // SHALL contain exactly one [1..1] Cognitive Abilities Observation (NEW)
         if (count($PortionData['CognitiveAbilitiesObservation']) > 0) {
             foreach ($PortionData['CognitiveAbilitiesObservation'] as $CognitiveAbilitiesObservation) {
                 $Section['component']['section']['entry'][] = LevelEntry\cognitiveAbilitiesObservation::Insert($CognitiveAbilitiesObservation, $CompleteData);
             }
         }
         // SHOULD contain zero or more [0..*] entry
         // SHALL contain exactly one [1..1] Mental Status Observation (NEW)
         if (count($PortionData['MentalStatusObservation']) > 0) {
             foreach ($PortionData['MentalStatusObservation'] as $MentalStatusObservation) {
                 $Section['component']['section']['entry'][] = LevelEntry\mentalStatusObservation::Insert($MentalStatusObservation, $CompleteData);
             }
         }
         return $Section;
     } catch (Exception $Error) {
         return $Error;
     }
 }