Skip to content

Commit

Permalink
added sex and dob
Browse files Browse the repository at this point in the history
  • Loading branch information
sunsetsystems committed Mar 21, 2009
1 parent a57f3e8 commit 1761deb
Show file tree
Hide file tree
Showing 2 changed files with 151 additions and 109 deletions.
41 changes: 41 additions & 0 deletions interface/new/new.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
$form_mname = $_POST['mname' ] ? trim($_POST['mname' ]) : '';
$form_lname = $_POST['lname' ] ? trim($_POST['lname' ]) : '';
$form_refsource = $_POST['refsource'] ? trim($_POST['refsource']) : '';
$form_sex = $_POST['sex' ] ? trim($_POST['sex' ]) : '';
$form_refsource = $_POST['refsource'] ? trim($_POST['refsource']) : '';
$form_dob = $_POST['DOB' ] ? trim($_POST['DOB' ]) : '';
$form_regdate = $_POST['regdate' ] ? trim($_POST['regdate' ]) : date('Y-m-d');
?>
<html>
Expand Down Expand Up @@ -117,6 +120,26 @@ function validate() {
</td>
</tr>

<tr>
<td>
<span class='bold'><?php xl('Sex','e'); ?>: </span>
</td>
<td>
<select name='sex'>
<option value=''>Unassigned</option>
<?php
$ores = sqlStatement("SELECT option_id, title FROM list_options " .
"WHERE list_id = 'sex' ORDER BY seq");
while ($orow = sqlFetchArray($ores)) {
echo " <option value='" . $orow['option_id'] . "'";
if ($orow['option_id'] == $form_sex) echo " selected";
echo ">" . $orow['title'] . "</option>\n";
}
?>
</select>
</td>
</tr>

<?php if ($GLOBALS['inhouse_pharmacy']) { ?>
<tr>
<td>
Expand All @@ -139,6 +162,24 @@ function validate() {
</tr>
<?php } ?>

<tr>
<td>
<span class='bold'><?php xl('Birth Date','e');?>: </span>
</td>
<td>
<input type='text' size='10' name='DOB' id='DOB'
value='<?php echo $form_dob; ?>'
onkeyup='datekeyup(this,mypcc)' onblur='dateblur(this,mypcc)'
title='yyyy-mm-dd' />
<img src='../pic/show_calendar.gif' align='absbottom' width='24' height='22'
id='img_dob' border='0' alt='[?]' style='cursor:pointer'
title='Click here to choose a date'>
<script LANGUAGE="JavaScript">
Calendar.setup({inputField:"DOB", ifFormat:"%Y-%m-%d", button:"img_dob"});
</script>
</td>
</tr>

<tr<?php echo $regstyle ?>>
<td>
<span class='bold'><?php xl('Registration Date','e');?>: </span>
Expand Down
219 changes: 110 additions & 109 deletions interface/new/new_patient_save.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
$pid = 0;
}

//what do we set for the public pid?
// what do we set for the public pid?
if (isset($_POST["pubpid"]) && ($_POST["pubpid"] != "")) {
$mypubpid = $_POST["pubpid"];
} else {
Expand All @@ -48,135 +48,136 @@

if ($_POST['form_create']) {

$form_fname = ucwords(trim($_POST["fname"]));
$form_lname = ucwords(trim($_POST["lname"]));
$form_mname = ucwords(trim($_POST["mname"]));

// ===================
// DBC SYSTEM
$form_dbcprefix = ( $GLOBALS['dutchpc'] ) ? ucwords(trim($_POST["dbc_prefix"])) : '' ;
$form_dbcprefixpartner = ( $GLOBALS['dutchpc'] ) ? trim($_POST["dbc_prefix_partner"]) : '' ;
$form_dbclastpartner = ( $GLOBALS['dutchpc'] ) ? trim($_POST["dbc_lastname_partner"]) : '' ;
$form_sex = ( $GLOBALS['dutchpc'] ) ? trim($_POST["dbc_sex"]) : '' ;
$form_fname = ucwords(trim($_POST["fname"]));
$form_lname = ucwords(trim($_POST["lname"]));
$form_mname = ucwords(trim($_POST["mname"]));

// ===================
// DBC SYSTEM
$form_dbcprefix = $GLOBALS['dutchpc'] ? ucwords(trim($_POST["dbc_prefix"])) : '' ;
$form_dbcprefixpartner = $GLOBALS['dutchpc'] ? trim($_POST["dbc_prefix_partner"]) : '' ;
$form_dbclastpartner = $GLOBALS['dutchpc'] ? trim($_POST["dbc_lastname_partner"]) : '' ;
$form_sex = $GLOBALS['dutchpc'] ? trim($_POST["dbc_sex"]) : trim($_POST["sex"]) ;
/****
// in db the value for sex is a word! so we must translate it
switch ( $form_sex ) {
case 1 : $form_sex = 'Male'; break;
case 2: $form_sex = 'Female'; break;
default: $form_sex = 'Male';
}
$form_voorletters = ( $GLOBALS['dutchpc'] ) ? trim($_POST["dbc_voorletters"]) : '' ;
$form_dob = ( $GLOBALS['dutchpc'] ) ? trim($_POST["dbc_geboort"]) : '' ;
$form_street = ( $GLOBALS['dutchpc'] ) ? trim($_POST["dbc_straat"]) : '' ;
$form_number = ( $GLOBALS['dutchpc'] ) ? trim($_POST["dbc_nummer"]) : '' ;
$form_addition = ( $GLOBALS['dutchpc'] ) ? trim($_POST["dbc_toevoe"]) : '' ;
$form_city = ( $GLOBALS['dutchpc'] ) ? trim($_POST["dbc_plaats"]) : '' ;
$form_postcode = ( $GLOBALS['dutchpc'] ) ? trim($_POST["dbc_postal"]) : '' ;
$form_countrycode = ( $GLOBALS['dutchpc'] ) ? trim($_POST["dbc_land"]) : '' ;
$form_provider = ( $GLOBALS['dutchpc'] ) ? trim($_POST["dbc_insurance"]) : '' ;
$form_insdate = ( $GLOBALS['dutchpc'] ) ? trim($_POST["dbc_insdatum"]) : '' ;
$form_policy = ( $GLOBALS['dutchpc'] ) ? trim($_POST["dbc_policy"]) : '' ;
// EOS DBC
// ===================

newPatientData(
$_POST["db_id"],
$_POST["title"],
$form_fname,
$form_lname,
$form_mname,
$form_sex, // sex
$form_dob, // dob
$form_street, // street
****/
$form_voorletters = $GLOBALS['dutchpc'] ? trim($_POST["dbc_voorletters"]) : '' ;
$form_dob = $GLOBALS['dutchpc'] ? trim($_POST["dbc_geboort"]) : trim($_POST["DOB"]) ;
$form_street = $GLOBALS['dutchpc'] ? trim($_POST["dbc_straat"]) : '' ;
$form_number = $GLOBALS['dutchpc'] ? trim($_POST["dbc_nummer"]) : '' ;
$form_addition = $GLOBALS['dutchpc'] ? trim($_POST["dbc_toevoe"]) : '' ;
$form_city = $GLOBALS['dutchpc'] ? trim($_POST["dbc_plaats"]) : '' ;
$form_postcode = $GLOBALS['dutchpc'] ? trim($_POST["dbc_postal"]) : '' ;
$form_countrycode = $GLOBALS['dutchpc'] ? trim($_POST["dbc_land"]) : '' ;
$form_provider = $GLOBALS['dutchpc'] ? trim($_POST["dbc_insurance"]) : '' ;
$form_insdate = $GLOBALS['dutchpc'] ? trim($_POST["dbc_insdatum"]) : '' ;
$form_policy = $GLOBALS['dutchpc'] ? trim($_POST["dbc_policy"]) : '' ;
// EOS DBC
// ===================

newPatientData(
$_POST["db_id"],
$_POST["title"],
$form_fname,
$form_lname,
$form_mname,
$form_sex, // sex
$form_dob, // dob
$form_street, // street
$form_street, // DBC use ---- $nstreet
$form_number, // DBC use ---- $nnr
$form_addition, // DBC use ---- $nadd
$form_postcode, // postal_code
$form_city, // city
"", // state
$form_countrycode, // country_code
"", // ss
"", // occupation
"", // phone_home
"", // phone_biz
"", // phone_contact
"", // status
"", // contact_relationship
"", // referrer
"", // referrerID
"", // email
"", // language
"", // ethnoracial
"", // interpreter
"", // migrantseasonal
"", // family_size
"", // monthly_income
"", // homeless
"", // financial_review
"$mypubpid",
$pid,
"", // providerID
"", // genericname1
"", // genericval1
"", // genericname2
"", // genericval2
"", // phone_cell
"", // hipaa_mail
"", // hipaa_voice
0, // squad
0, // $pharmacy_id = 0,
"", // $drivers_license = "",
"", // $hipaa_notice = "",
"", // $hipaa_message = "",
$_POST['regdate'],
// ======== dutch specific
$form_dbcprefix, // $prefixlast
$form_dbcprefixpartner, // $prefixlastpartner
$form_dbclastpartner, // $lastpartner
$form_voorletters, // initials
"", // $provider_data
"" // $referer_data
// ======== EOS dutch specific

);

newEmployerData($pid);
newHistoryData($pid);
newInsuranceData($pid, "primary");
newInsuranceData($pid, "secondary");
newInsuranceData($pid, "tertiary");


// DBC DUTCH INSURANCE DATA
if ( $GLOBALS['dutchpc'] ) set_insurer_nl($pid, $form_provider, $form_insdate, $form_policy);
// EOS DBC

// Set referral source separately because we don't want it messed
// with later by newPatientData().
if ($refsource = trim($_POST["refsource"])) {
sqlQuery("UPDATE patient_data SET referral_source = '$refsource' " .
"WHERE pid = '$pid'");
}
$form_postcode, // postal_code
$form_city, // city
"", // state
$form_countrycode, // country_code
"", // ss
"", // occupation
"", // phone_home
"", // phone_biz
"", // phone_contact
"", // status
"", // contact_relationship
"", // referrer
"", // referrerID
"", // email
"", // language
"", // ethnoracial
"", // interpreter
"", // migrantseasonal
"", // family_size
"", // monthly_income
"", // homeless
"", // financial_review
"$mypubpid",
$pid,
"", // providerID
"", // genericname1
"", // genericval1
"", // genericname2
"", // genericval2
"", // phone_cell
"", // hipaa_mail
"", // hipaa_voice
0, // squad
0, // $pharmacy_id = 0,
"", // $drivers_license = "",
"", // $hipaa_notice = "",
"", // $hipaa_message = "",
$_POST['regdate'],
// ======== dutch specific
$form_dbcprefix, // $prefixlast
$form_dbcprefixpartner, // $prefixlastpartner
$form_dbclastpartner, // $lastpartner
$form_voorletters, // initials
"", // $provider_data
"" // $referer_data
// ======== EOS dutch specific
);

newEmployerData($pid);
newHistoryData($pid);
newInsuranceData($pid, "primary");
newInsuranceData($pid, "secondary");
newInsuranceData($pid, "tertiary");


// DBC DUTCH INSURANCE DATA
if ( $GLOBALS['dutchpc'] ) set_insurer_nl($pid, $form_provider, $form_insdate, $form_policy);
// EOS DBC

// Set referral source separately because we don't want it messed
// with later by newPatientData().
if ($refsource = trim($_POST["refsource"])) {
sqlQuery("UPDATE patient_data SET referral_source = '$refsource' " .
"WHERE pid = '$pid'");
}

// DBC Dutch System
if ( $GLOBALS['dutchpc'] ) {
generate_id1250($pid); // generate an ID1250 number
if ( $GLOBALS['dutchpc'] ) {
generate_id1250($pid); // generate an ID1250 number
}

}
?>
<html>
<body>
<script language="Javascript">
<?
if ($alertmsg) {
<?php
if ($alertmsg) {
echo "alert('$alertmsg');\n";
}
if ($GLOBALS['concurrent_layout']) {
}
if ($GLOBALS['concurrent_layout']) {
echo "window.location='$rootdir/patient_file/summary/demographics.php?" .
"set_pid=$pid&is_new=1';\n";
} else {
"set_pid=$pid&is_new=1';\n";
} else {
echo "window.location='$rootdir/patient_file/patient_file.php?set_pid=$pid';\n";
}
}
?>
</script>

Expand Down

0 comments on commit 1761deb

Please sign in to comment.