~intrahealth+informatics/ihris-common/4.3-dev

« back to all changes in this revision

Viewing changes to modules/FHIR/modules/Questionnaire/tests/questionniare-test-form-load.php

  • Committer: Carl Leitner
  • Date: 2016-07-09 16:29:01 UTC
  • mto: This revision was merged to the branch mainline in revision 1454.
  • Revision ID: litlfred@ibiblio.org-20160709162901-bfr3cv3vseb7dfw4
added fhir questionnaire -> form code.   added base fhir helper classes:

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?php
 
2
/*
 
3
 * © Copyright 2007, 2008 IntraHealth International, Inc.
 
4
 * 
 
5
 * This File is part of iHRIS
 
6
 * 
 
7
 * iHRIS is free software; you can redistribute it and/or modify
 
8
 * it under the terms of the GNU General Public License as published by
 
9
 * the Free Software Foundation; either version 3 of the License, or
 
10
 * (at your option) any later version.
 
11
 * 
 
12
 * This program is distributed in the hope that it will be useful,
 
13
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
14
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
15
 * GNU General Public License for more details.
 
16
 * 
 
17
 * You should have received a copy of the GNU General Public License
 
18
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
19
 */
 
20
/**
 
21
 * The page wrangler
 
22
 * 
 
23
 * This page loads the main HTML template for the home page of the site.
 
24
 * @package iHRIS
 
25
 * @subpackage DemoManage
 
26
 * @access public
 
27
 * @author Carl Leitner <litlfred@ibiblio.org>
 
28
 * @copyright Copyright &copy; 2007, 2008 IntraHealth International, Inc. 
 
29
 * @since Demo-v2.a
 
30
 * @version Demo-v2.a
 
31
 */
 
32
 
 
33
 
 
34
$i2ce_site_user_access_init = null;
 
35
require_once( dirname(__FILE__) . DIRECTORY_SEPARATOR . 'config.values.php');
 
36
 
 
37
$local_config = dirname(__FILE__) . DIRECTORY_SEPARATOR .
 
38
'local' . DIRECTORY_SEPARATOR . 'config.values.php';
 
39
if (file_exists($local_config)) {
 
40
    require_once($local_config);
 
41
}
 
42
 
 
43
if(!isset($i2ce_site_i2ce_path) || !is_dir($i2ce_site_i2ce_path)) {
 
44
    echo "Please set the \$i2ce_site_i2ce_path in $local_config";
 
45
    exit(55);
 
46
}
 
47
 
 
48
require_once ($i2ce_site_i2ce_path . DIRECTORY_SEPARATOR . 'I2CE_config.inc.php');
 
49
@I2CE::initializeDSN($i2ce_site_dsn,   $i2ce_site_user_access_init,    $i2ce_site_module_config);         
 
50
 
 
51
 
 
52
unset($i2ce_site_user_access_init);
 
53
unset($i2ce_site_dsn);
 
54
unset($i2ce_site_i2ce_path);
 
55
unset($i2ce_site_module_config);
 
56
 
 
57
$flow_uuids = array('74b73680-ace3-4010-a96f-05d6f0138881','ef188a2d-fc8d-4aa2-ac5c-6f2d04dff431','bad');
 
58
$q = new I2CE_FHIR_Questionnaire();
 
59
$qr = new I2CE_FHIR_QuestionnaireResponse();
 
60
 
 
61
 
 
62
foreach ($flow_uuids as $flow_uuid ) {
 
63
    echo "===================================================================\n\n\n\nDOING       $flow_uuid\n\n\===================================================================\n";
 
64
    $url = "http://localhost:3001/fhir/DSTU2/Questionnaire/$flow_uuid";
 
65
    $q->load_resource($url);
 
66
    $q->create_form('person');
 
67
    //$qr = new I2CE_FHIR_QuestionnaireResponse();
 
68
    //$url = "http://localhost:3001/fhir/DSTU2/QuestionnaireResponse/_search?questionnaire=$flow_uuid";
 
69
    //$qr->load_resource($url);
 
70
}
 
71
 
 
72
# Local Variables:
 
73
# mode: php
 
74
# c-default-style: "bsd"
 
75
# indent-tabs-mode: nil
 
76
# c-basic-offset: 4
 
77
# End: