当前位置: 首页>>代码示例>>PHP>>正文


PHP newHistoryData函数代码示例

本文整理汇总了PHP中newHistoryData函数的典型用法代码示例。如果您正苦于以下问题:PHP newHistoryData函数的具体用法?PHP newHistoryData怎么用?PHP newHistoryData使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了newHistoryData函数的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: get_layout_form_value

        $field_id = $frow['field_id'];
        $table = 'patient_data';
        if (isset($_POST["form_{$field_id}"])) {
            $newdata[$table][$field_id] = get_layout_form_value($frow);
        }
    }
    if (empty($ptid)) {
        $tmp = sqlQuery("SELECT MAX(pid)+1 AS pid FROM patient_data");
        $ptid = empty($tmp['pid']) ? 1 : intval($tmp['pid']);
        if (empty($newdata['patient_data']['pubpid'])) {
            // pubpid for new patient defaults to pid.
            $newdata['patient_data']['pubpid'] = "{$ptid}";
        }
        updatePatientData($ptid, $newdata['patient_data'], true);
        updateEmployerData($ptid, $newdata['employer_data'], true);
        newHistoryData($ptid);
    } else {
        $newdata['patient_data']['id'] = $_POST['db_id'];
        updatePatientData($ptid, $newdata['patient_data']);
    }
    // Finally, delete the request from the portal.
    $result = cms_portal_call(array('action' => 'delpost', 'postid' => $postid));
    if ($result['errmsg']) {
        die(text($result['errmsg']));
    }
    echo "<html><body><script language='JavaScript'>\n";
    echo "if (top.restoreSession) top.restoreSession(); else opener.top.restoreSession();\n";
    echo "document.location.href = 'list_requests.php';\n";
    echo "</script></body></html>\n";
    exit;
}
开发者ID:mi-squared,项目名称:openemr,代码行数:31,代码来源:patient_form.php

示例2: getPatientData

<?php 
if (acl_check('patients', 'med')) {
    $tmp = getPatientData($pid, "squad");
    if ($tmp['squad'] && !acl_check('squads', $tmp['squad'])) {
        echo "<p>(" . htmlspecialchars(xl('History not authorized'), ENT_NOQUOTES) . ")</p>\n";
        echo "</body>\n</html>\n";
        exit;
    }
} else {
    echo "<p>(" . htmlspecialchars(xl('History not authorized'), ENT_NOQUOTES) . ")</p>\n";
    echo "</body>\n</html>\n";
    exit;
}
$result = getHistoryData($pid);
if (!is_array($result)) {
    newHistoryData($pid);
    $result = getHistoryData($pid);
}
?>

<?php 
if (acl_check('patients', 'med', '', array('write', 'addonly'))) {
    ?>
<div>
    <span class="title"><?php 
    echo htmlspecialchars(xl('Patient History / Lifestyle'), ENT_NOQUOTES);
    ?>
</span>
</div>
<div id='namecontainer_history' class='namecontainer_history' style='float:left;margin-right:10px'>
<?php 
开发者ID:juggernautsei,项目名称:openemr,代码行数:31,代码来源:history.php

示例3: create_skeleton_patient

/**
 * Create a patient using whatever patient_data attributes are provided.
 */
function create_skeleton_patient($patient_data)
{
    $employer_data = array();
    $tmp = sqlQuery("SELECT MAX(pid)+1 AS pid FROM patient_data");
    $ptid = empty($tmp['pid']) ? 1 : intval($tmp['pid']);
    if (!isset($patient_data['pubpid'])) {
        $patient_data['pubpid'] = $ptid;
    }
    updatePatientData($ptid, $patient_data, true);
    updateEmployerData($ptid, $employer_data, true);
    newHistoryData($ptid);
    return $ptid;
}
开发者ID:mi-squared,项目名称:openemr,代码行数:16,代码来源:receive_hl7_results.inc.php

示例4: batch_despatch

 public static function batch_despatch($var, $func, $data_credentials)
 {
     global $pid;
     if (UserService::valid($data_credentials)) {
         require_once "../../library/invoice_summary.inc.php";
         require_once "../../library/options.inc.php";
         require_once "../../library/acl.inc";
         require_once "../../library/patient.inc";
         if ($func == 'ar_responsible_party') {
             $patient_id = $pid;
             $encounter_id = $var['encounter'];
             $x['ar_responsible_party'] = ar_responsible_party($patient_id, $encounter_id);
             return UserService::function_return_to_xml($x);
         } elseif ($func == 'getInsuranceData') {
             $type = $var['type'];
             $given = $var['given'];
             $x = getInsuranceData($pid, $type, $given);
             return UserService::function_return_to_xml($x);
         } elseif ($func == 'generate_select_list') {
             $tag_name = $var['tag_name'];
             $list_id = $var['list_id'];
             $currvalue = $var['currvalue'];
             $title = $var['title'];
             $empty_name = $var['empty_name'];
             $class = $var['class'];
             $onchange = $var['onchange'];
             $x['generate_select_list'] = generate_select_list($tag_name, $list_id, $currvalue, $title, $empty_name, $class, $onchange);
             return UserService::function_return_to_xml($x);
         } elseif ($func == 'xl_layout_label') {
             $constant = $var['constant'];
             $x['xl_layout_label'] = xl_layout_label($constant);
             return UserService::function_return_to_xml($x);
         } elseif ($func == 'generate_form_field') {
             $frow = $var['frow'];
             $currvalue = $var['currvalue'];
             ob_start();
             generate_form_field($frow, $currvalue);
             $x['generate_form_field'] = ob_get_contents();
             ob_end_clean();
             return UserService::function_return_to_xml($x);
         } elseif ($func == 'getInsuranceProviders') {
             $i = $var['i'];
             $provider = $var['provider'];
             $insurancei = getInsuranceProviders();
             $x = $insurancei;
             return $x;
         } elseif ($func == 'get_layout_form_value') {
             $frow = $var['frow'];
             $_POST = $var['post_array'];
             $x['get_layout_form_value'] = get_layout_form_value($frow);
             return UserService::function_return_to_xml($x);
         } elseif ($func == 'updatePatientData') {
             $patient_data = $var['patient_data'];
             $create = $var['create'];
             updatePatientData($pid, $patient_data, $create);
             $x['ok'] = 'ok';
             return UserService::function_return_to_xml($x);
         } elseif ($func == 'updateEmployerData') {
             $employer_data = $var['employer_data'];
             $create = $var['create'];
             updateEmployerData($pid, $employer_data, $create);
             $x['ok'] = 'ok';
             return UserService::function_return_to_xml($x);
         } elseif ($func == 'newHistoryData') {
             newHistoryData($pid);
             $x['ok'] = 'ok';
             return UserService::function_return_to_xml($x);
         } elseif ($func == 'newInsuranceData') {
             $_POST = $var[0];
             foreach ($var as $key => $value) {
                 if ($key >= 3) {
                     $var[$key] = formData($value);
                 }
                 if ($key >= 1) {
                     $parameters[$key] = $var[$key];
                 }
             }
             $parameters[12] = fixDate($parameters[12]);
             $parameters[27] = fixDate($parameters[27]);
             call_user_func_array('newInsuranceData', $parameters);
             $x['ok'] = 'ok';
             return UserService::function_return_to_xml($x);
         } elseif ($func == 'generate_layout_validation') {
             $form_id = $var['form_id'];
             ob_start();
             generate_layout_validation($form_id);
             $x = ob_get_clean();
             return $x;
         }
     } else {
         throw new SoapFault("Server", "credentials failed");
     }
 }
开发者ID:jatin-52,项目名称:erm,代码行数:93,代码来源:server_side.php

示例5: create_patient

function create_patient(&$medics, &$errors)
{
    $alertmsg = "";
    $patient_pid = get_patientid($medics);
    $pubpid = trim($medics->pubpid);
    // ID must be valid or 'NEWPATIENT'
    if (empty($pubpid)) {
        array_push($errors, "Patient ID '{$pubpid}' missing, patient skipped! ");
        return $alertmsg;
    }
    if ($pubpid != 'NEWPATIENT') {
        // 1. validate patient
        $patient_pid = 0;
        $query = "SELECT pid FROM patient_data WHERE pubpid LIKE '{$pubpid}'";
        $res = sqlStatement($query);
        $row = sqlFetchArray($res);
        if ($row) {
            $patient_pid = $row['pid'];
            if (sqlFetchArray($res)) {
                array_push($errors, "Patient ID '{$pubpid}' is ambiguous, patient skipped! ");
                return $alertmsg;
            } else {
                // array_push( $errors, "Patient ID '$pubpid' exists, updates/new encounters only. ");
            }
        }
    }
    // 2. validate insurance provider - REMOVED
    // 3. validate billing provider
    $tmp = array();
    $tmp = fetchProviderInfo($medics);
    if (!array($tmp)) {
        array_push($errors, "Provider '{$tmp}' not found, patient skipped!");
        return $alertmsg;
    }
    $patient_provider_id = $tmp['id'];
    $patient_provider_name = $tmp['username'];
    $patient_provider_facility = $tmp['facility_id'];
    // 4. get facility from  // Move to function
    $row = sqlQuery("SELECT id, name, pos_code FROM facility WHERE id = '{$patient_provider_facility}'");
    if (!$row['id']) {
        array_push($errors, "Facility '{$tmp}' not found, patient skipped! ");
        return $alertmsg;
    }
    $patient_facility_id = $row['id'];
    $patient_facility_name = $row['name'];
    $patient_facility_pos = $row['pos_code'];
    // 5. insert patient data
    if (!$patient_pid) {
        // Insert into patient_data.
        //
        $row = sqlQuery("SELECT max(pid)+1 AS pid FROM patient_data");
        $patient_pid = $row['pid'] ? $row['pid'] : 1;
        // Combine street lines
        $patient_street = $medics->street . ' ' . $medics->street2;
        // Build array
        newPatientData('', '', form2db($medics->fname), form2db($medics->lname), form2db($medics->mname), sex($medics->sex), form2db($medics->dob), form2db($patient_street), '', '', '', form2db($medics->zip), form2db($medics->city), form2db($medics->state), '', '', '', form2db($medics->phone_home), form2db($medics->phone_alternate), '', '', '', '', '', '', '', form2db($medics->ethnicity), '', '', '', '', '', '0000-00-00 00:00:00', $patient_pid, $patient_pid, '', '', '', '', '', '', form2db($medics->hippa_notice), form2db($medics->hippa_notice), '', '', '', form2db($medics->hippa_notice), '', $dos = fixDate($medics->fromdate));
        // Insert dummy row for employer_data.
        newEmployerData($patient_pid);
        // Update or Instest subscriber ins data
        if ($medics->pubpid == 'NEWPATIENT' || !empty($medics->policy_id)) {
            newInsuranceData($patient_pid, 'primary', $insurance_company_id, form2db($medics->policy_id), '', '', form2db($medics->lname), form2db($medics->mname), form2db($medics->fname), 'self', '', fixDate($medics->dob), form2db($medics->street), form2db($medics->zip), form2db($medics->city), form2db($medics->state), '', form2db($medics->phone_home), '', '', '', '', '', '', '', sex($medics->sex), fixDate($medics->eff_date));
        }
        $tmp = $medics->lname . ',' . $medics->fname;
        $alertmsg .= "New Patient Added: '{$patient_pid}' / '{$tmp}' <br>\n";
    }
    $medics->pid = $patient_pid;
    $history = array('history_father' => form2db($medics->familyinformation->father), 'history_mother' => form2db($medics->familyinformation->mother), 'history_spouse' => form2db($medics->familyinformation->spouse), 'history_siblings' => form2db($medics->familyinformation->siblings), 'history_offspring' => form2db($medics->familyinformation->offspring), 'relatives_cancer' => form2db($medics->medical->relativesexperience->cancer), 'relatives_tuberculosis' => form2db($medics->medical->relativesexperience->tuberculosis), 'relatives_diabetes' => form2db($medics->medical->relativesexperience->diabetes), 'relatives_high_blood_pressure' => form2db($medics->medical->relativesexperience->highbloodpressure), 'relatives_heart_problems' => form2db($medics->medical->relativesexperience->heartproblems), 'relatives_stroke' => form2db($medics->medical->relativesexperience->stroke), 'relatives_epilepsy' => form2db($medics->medical->relativesexperience->epilepsy), 'relatives_mental_illness' => form2db($medics->medical->relativesexperience->mentalillness), 'relatives_suicide' => form2db($medics->medical->relativesexperience->suicide), 'usertext12' => form2db($medics->medical->relativesexperience->other), 'coffee' => form2db($medics->medical->lifestyleusage->coffee), 'tobacco' => form2db($medics->medical->lifestyleusage->tobacco), 'alcohol' => form2db($medics->medical->lifestyleusage->alcohol), 'sleep_patterns' => form2db($medics->medical->lifestyleusage->sleep), 'exercise_patterns' => form2db($medics->medical->lifestyleusage->exercise), 'seatbelt_use' => form2db($medics->medical->lifestyleusage->seatbelt), 'counseling' => form2db($medics->medical->lifestyleusage->counseling), 'hazardous_activities' => form2db($medics->medical->lifestyleusage->hazardactivities), 'usertext13' => form2db($medics->medical->lifestyleusage->urinaryincontinence), 'usertext14' => form2db($medics->medical->lifestyleusage->fallhistory), 'additional_history' => form2db($medics->medical->lifestyleusage->other) . " " . form2db($medics->medical->lifestyleusage->generalnotes));
    // Insert/Update into history_data.
    if ($medics->pubpid == 'NEWPATIENT') {
        newHistoryData($patient_pid, $history);
    } else {
        updateHistoryData($patient_pid, $history);
    }
    // Add or Update History data
    add_update_history($medics, $patient_pid, $errors);
    // Create or update an issue for each historical medication.
    //
    foreach ($medics->medical->medications->medication as $medication) {
        if (isempty($medication->name)) {
            continue;
        }
        $meds = array();
        $meds['title'] = form2db($medication->name);
        $meds['dosage'] = form2db($medication->dosage);
        $meds['frequency'] = form2db($medication->frequency);
        $meds['duration'] = form2db($medication->duration);
        // TBD does not exsist in MEDICS
        $meds['id'] = form2db($medication->id);
        if (!isempty($meds['id'])) {
            $row = sqlQuery("SELECT id FROM lists WHERE id = " . $meds['id']);
            if (!$row) {
                create_issue($patient_pid, 'medication', $meds);
            } else {
                update_issue($patient_pid, 'medication', $meds);
            }
        } else {
            create_issue($patient_pid, 'medication', $meds);
        }
    }
    return $alertmsg;
//.........这里部分代码省略.........
开发者ID:aaricpittman,项目名称:openemr,代码行数:101,代码来源:import_mi2xml.php


注:本文中的newHistoryData函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。