コード例 #1
0
ファイル: problems.php プロジェクト: igez/gaiaehr
 /**
  * @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.5.1.2']], 'code' => ['@attributes' => ['code' => '11450-4', 'displayName' => 'Problem List', 'codeSystem' => '2.16.840.1.113883.6.1', 'codeSystemName' => 'LOINC']], 'title' => 'Problem List', 'text' => self::Narrative($PortionData)]]];
         // MAY contain zero or more [1..*] entry
         // SHALL contain exactly one [1..1] Problem Concern Act (Condition) (V2)
         if (count($PortionData['ProblemConcernAct']) > 0) {
             foreach ($PortionData['ProblemConcernAct'] as $ProblemConcernAct) {
                 $Section['component']['section']['entry'][] = ['@attributes' => ['typeCode' => 'DRIV'], LevelEntry\problemConcernAct::Insert($ProblemConcernAct, $CompleteData)];
             }
         }
         // MAY contain zero or more [0..*] entry
         // SHALL contain exactly one [1..1] Health Status Observation (V2)
         if (count($PortionData['HealthStatusObservation']) > 0) {
             foreach ($PortionData['HealthStatusObservation'] as $HealthStatusObservation) {
                 $Section['component']['section']['entry'][] = LevelEntry\healthStatusObservation::Insert($HealthStatusObservation, $CompleteData);
             }
         }
         return $Section;
     } catch (Exception $Error) {
         return $Error;
     }
 }
コード例 #2
0
ファイル: healthConcerns.php プロジェクト: igez/gaiaehr
 /**
  * @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.58', 'extension' => $PortionData['AdvanceDirectives']['date']]], 'code' => ['@attributes' => ['code' => '46030-3', 'codeSystem' => '2.16.840.1.113883.6.1', 'codeSystemName' => 'LOINC', 'displayName' => 'Health Concerns Section']], 'title' => 'Health Concerns Section', 'text' => self::Narrative($PortionData)]]];
         // SHOULD contain zero or more [0..*] entry
         // SHALL contain exactly one [1..1] Health Status Observation (V2)
         if (count($PortionData['HealthStatusObservation']) > 0) {
             foreach ($PortionData['HealthStatusObservation'] as $HealthStatusObservation) {
                 $Section['component']['section']['entry'][] = LevelEntry\healthStatusObservation::Insert($HealthStatusObservation, $CompleteData);
             }
         }
         // SHOULD contain zero or more [0..*] entry
         // SHALL contain exactly one [1..1] Health Concern Act (NEW)
         if (count($PortionData['HealthConcernAct']) > 0) {
             foreach ($PortionData['HealthConcernAct'] as $HealthConcernAct) {
                 $Section['component']['section']['entry'][] = LevelEntry\healthConcernAct::Insert($HealthConcernAct, $CompleteData);
             }
         }
         return $Section;
     } catch (Exception $Error) {
         return $Error;
     }
 }