Ejemplo n.º 1
0
 /**
  * @param $PortionData
  * @param $CompleteData
  * @return array|Exception
  */
 public static function Insert($PortionData, $CompleteData)
 {
     try {
         // Validate first
         self::Validate($PortionData);
         $Entry = ['organizer' => ['@attributes' => ['classCode' => 'CLUSTER', 'moodCode' => 'EVN'], 'templateId' => Component::templateId('2.16.840.1.113883.10.20.22.4.66.2'), 'id' => Component::id(Utilities::UUIDv4()), 'code' => ['@attributes' => ['code' => 'd5', 'displayName' => 'Self-Care', 'codeSystem' => '2.16.840.1.113883.6.254', 'codeSystemName' => 'ICF']], 'statusCode' => Component::statusCode('completed')]];
         // SHOULD contain zero or more [0..*] Author Participation (NEW)
         // (templateId:2.16.840.1.113883.10.20.22.4.119) (CONF:31585)
         if (count($PortionData['Authors']) > 0) {
             foreach ($PortionData['Authors'] as $Author) {
                 $Entry['organizer']['author'][] = LevelDocument\author::Insert($Author);
             }
         }
         // SHALL contain at least one [1..*] component (CONF:14359)
         // SHALL contain exactly one [1..1] Functional Status Observation (V2)
         // (templateId:2.16.840.1.113883.10.20.22.4.67.2) (CONF:14368)
         if (count($PortionData['FunctionalStatusObservation']) > 0) {
             foreach ($PortionData['FunctionalStatusObservation'] as $FunctionalStatusObservation) {
                 $Entry['organizer']['component'][] = functionalStatusObservation::Insert($FunctionalStatusObservation, $CompleteData);
             }
         }
         // SHALL contain at least one [1..*] component (CONF:31432)
         // SHALL contain exactly one [1..1] Self-Care Activities (ADL and IADL) (NEW)
         // (templateId:2.16.840.1.113883.10.20.22.4.128) (CONF:31433)
         if (count($PortionData['SelfCareActivities_ADL_IADL']) > 0) {
             foreach ($PortionData['SelfCareActivities_ADL_IADL'] as $SelfCareActivities_ADL_IADL) {
                 $Entry['organizer']['component'][] = selfCareActivitiesADLAndIADL::Insert($SelfCareActivities_ADL_IADL, $CompleteData);
             }
         }
         return $Entry;
     } catch (Exception $Error) {
         return $Error;
     }
 }
Ejemplo n.º 2
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.141'), 'code' => ['@attributes' => ['code' => '432138007', 'displayName' => 'handoff communication (procedure)', 'codeSystem' => '2.16.840.1.113883.6.96', 'codeSystemName' => 'SNOMED CT']], 'statusCode' => Component::statusCode('completed'), 'effectiveTime' => Component::time($PortionData['effectiveTime']), 'author' => LevelDocument\author::Insert($PortionData['Author']), 'participant' => ['@attributes' => ['typeCode' => 'IRCP'], 'participantRole' => ['code' => $PortionData['participant']['taxonomyCode'], 'codeSystem' => Utilities::CodingSystemId($PortionData['participant']['taxonomyCodeSystemName']), 'codeSystemName' => $PortionData['participant']['taxonomyCodeSystemName'], 'displayName' => $PortionData['participant']['taxonomyDisplayName']]]]];
         return $Entry;
     } catch (Exception $Error) {
         return $Error;
     }
 }
Ejemplo n.º 3
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.64'), 'code' => ['@attributes' => ['code' => '48767-8', 'codeSystem' => '2.16.840.1.113883.6.1', 'codeSystemName' => 'LOINC', 'displayName' => 'Annotation Comment']], 'text' => self::Narrative($PortionData)]];
         // MAY contain zero or one [0..1] author (CONF:9433).
         if (count($PortionData['Author']) > 0) {
             $Entry['act']['author'][] = LevelDocument\author::Insert($PortionData['Author'][0]);
         }
         return $Entry;
     } catch (Exception $Error) {
         return $Error;
     }
 }
Ejemplo n.º 4
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;
     }
 }