Since: 19/09/2010
Author: Julien PIERRE
Ejemplo n.º 1
0
 private function getTemplates($dir)
 {
     $data = array();
     foreach (glob(__DIR__ . '/' . __CLASS__ . "/{$dir}/*.template.json") as $template_path) {
         preg_match('|([^/]+)\\.template\\.json$|', $template_path, $m);
         $name = $m[1];
         $structure_path = str_replace('.template.json', '.structure.json', $template_path);
         $values_path = str_replace('.template.json', '.values.json', $template_path);
         $data[] = array($name, DataTemplate::fromJsonFile($template_path), json_decode(file_get_contents($structure_path)), file_exists($values_path) ? json_decode(file_get_contents($values_path), true) : array());
     }
     return $data;
 }
Ejemplo n.º 2
0
 protected static function getFhirTemplate()
 {
     return \DataTemplate::fromJsonFile(__DIR__ . '/fhir_templates/Practice.json', array('system_uri_practice_code' => \Yii::app()->params['fhir_system_uris']['practice_code']));
 }
Ejemplo n.º 3
0
 protected static function getFhirTemplate()
 {
     return \DataTemplate::fromJsonFile(__DIR__ . '/fhir_templates/CommissioningBody.json', array('system_uri_cb_code' => \Yii::app()->params['fhir_system_uris']['cb_code']));
 }
Ejemplo n.º 4
0
 protected static function getFhirTemplate()
 {
     $class = new \ReflectionClass(get_called_class());
     $path = dirname($class->getFileName()) . '/fhir_templates/' . $class->getShortName() . '.json';
     return \DataTemplate::fromJsonFile($path);
 }
Ejemplo n.º 5
0
 protected static function getFhirTemplate()
 {
     return \DataTemplate::fromJsonFile(__DIR__ . '/fhir_templates/Patient.json', array('system_uri_nhs_num' => \Yii::app()->params['fhir_system_uris']['nhs_num'], 'system_uri_hos_num' => \Yii::app()->params['fhir_system_uris']['hos_num']));
 }
Ejemplo n.º 6
0
 /**
  * @expectedException Exception
  * @expectedExceptionMessage Missing template constant: 'const1'
  */
 public function testMissingConstant()
 {
     DataTemplate::fromJsonFile(__DIR__ . '/' . __CLASS__ . '/generate-match/const.template.json');
 }