MSV FM

dot.antimicrobial@66.96.161.157: ~ $
Path : /hermes/sb_web/b1536/advancedfunctions.co/rms_V2/
File Upload :
Current < : //hermes/sb_web/b1536/advancedfunctions.co/rms_V2/index.html

<html>
<head>
<meta http-equiv='Content-Type' content='text/html; charset=UTF-8'>
<meta name='viewport' content='width=device-width, initial-scale=1.0'>
<link rel='stylesheet' href='https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css'>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script src='googleSheetsPortal.js'></script>
<script src='guiForm.js'></script>
<script src='gui.js'></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
</head>

<body>
<div id='uI'>
</div>
<div id='status' style= 'margin: auto; width:300px;text-align:center;' ><br></div>
<br>
</body>

<script>
var googleSheetsPortalScript='https://script.google.com/macros/s/AKfycbyjR3Ac6BeNkn1uoeGFoiNtr8amdyyII6bywaa8Z9aMKIr11FQ/exec';

var patientInfo='';
var testName='';
makePicture('accessMedicalLogo.png');
makeTitle('Part 1 / 3');
makeField('Identification number');
makeHeading('Personal information');
makeField('First name');
makeField('Last name');
makeDateField('Date of birth');
makeField('Sex');
makeField('Phone number');
makeField('Email address');
makeHeading('Test name');
makeChoice('antigen','Antigen');
makeChoice('pcr','PCR');
makeHeading('Address');
makeField('Apt #');
makeField('House #');
makeField('Street name');
makeField('City');
makeField('Island');
makeField('Country');
makeHeading('Government ID');
makeChoice('passport','Passport');
makeChoice('nib','NIB');
makeField('ID Number');
makeField('Nationality');
makeTitle('Part 2 / 3');
makeHeading('Reason for testing');
makeChoice('returnFromTravel','Return from travel');
makeChoice('forTravel','For travel');
makeChoice('re-entryIntoWorkspace','Re-entry into workspace');
makeChoice('work','Work');
makeChoice('screening','Screening');
makeChoice('other','Other');
makeBreak();
makeHeading('COVID-19 symptoms (last 14 days)');
makeChoice('yes','Yes');
makeChoice('no','No');
makeHeading('Symptoms');
makeChoice('abdominalPain','Abdominal Pain');
makeChoice('chills','Chills');
makeChoice('diarrhea','Diarrhea');
makeChoice('dryCough','Dry cough');
makeChoice('fatigue','Fatigue');
makeChoice('fever','Fever');
makeChoice('headache','Headache');
makeChoice('myalgia','Myalgia');
makeChoice('lossOfTaste','Loss of taste');
makeChoice('lossOfSmell','Loss of smell');
makeChoice('shortnessOfBreath','Shortness of breath');
makeChoice('vomiting','Vomiting');
makeDateField('Onset date');
makeBreak();
makeHeading('Contact with known case');
makeText('contactWithKnownCase','Was there close contact with a known positive case within the past 14 days? (Close contact is defined as contact for more than 15 minutes and within less than 6 feet)');
makeChoice('contactYes','Yes');
makeChoice('contactNo','No');
makeDateField('Contact date');
makeTitle('Part 3/3');
makeHeading('COVID-19 Vaccination Status');
makeChoice('notVaccinated','Not vaccinated');
makeChoice('partiallyVaccinated','Partially vaccinated');
makeChoice('fullyVaccinated','Fully vaccinated');

displayUi('uI',getFormUiAsString());

setPCRInfoEnabled(false);
setSymptomInfoEnabled(false);
setExposureInfoEnabled(false);

function send(){

if(parseInt(getFieldText('yearField'))<1000){
setFieldText('yearField','');
}

if(isFieldsFilled()){
displayUi('status','');
setEnabled('submitButtonGuiForm',false);
sendDataToGoogleSheets(['patientIsRegistering',getFieldText('Identification number'),getFieldText('First name'),getFieldText('Last name'),getFieldText('Date of birth|monthField')+'-'+getFieldText('Date of birth|dayField')+'-'+getFieldText('Date of birth|yearField'),0,getFieldText('Sex'),getFieldText('Phone number'),getFieldText('Email address'),testName,patientInfo],googleSheetsPortalScript);
displayUi('status',"<i class='fa fa-gear fa-spin' style='font-size:24px;color:lightgray'></i>");
}else{
isCharactersValid('Identification number', 'numeric');
isCharactersValid('First name', 'alpha');
isCharactersValid('Last name', 'alpha');
isCharactersValid('Date of birth|monthField','numeric');
isCharactersValid('Date of birth|dayField','numeric');
isCharactersValid('Date of birth|yearField','numeric');
isCharactersValid('Phone number', 'numeric');
isCharactersValid('Sex', 'alpha');
isCharactersValid('Email address','');
displayUi('status','Invalid characters');
}
}

function isFieldsFilled(){
var fieldsFilled=true;
patientInfo='';

if(!isCharactersValid('Identification number', 'numeric')){fieldsFilled=false;}
if(!isCharactersValid('First name', 'alpha')){fieldsFilled=false;}
if(!isCharactersValid('Last name', 'alpha')){fieldsFilled=false;}
if(!isCharactersValid('Date of birth|monthField','numeric')){fieldsFilled=false;}
if(!isCharactersValid('Date of birth|dayField','numeric')){fieldsFilled=false;}
if(!isCharactersValid('Date of birth|yearField','numeric')){fieldsFilled=false;}
if(!isCharactersValid('Phone number', 'numeric')){fieldsFilled=false;}
if(!isCharactersValid('Sex', 'alpha')){fieldsFilled=false;}
if(!isCharactersValid('Email address','')){fieldsFilled=false;}
displayUi('status','Invalid characters');

setWarning('Apt #', false);
setWarning('House #', false);
setWarning('Street name',false);
setWarning('City',false);
setWarning('Island',false);
setWarning('Country',false);
setWarning('ID Number', '');
setWarning('Nationality', false);
setWarning('Test name',false);
if(!getValue('pcr')&&!getValue('antigen')){
setWarning('Test name',true);
fieldsFilled=false;
}else{
setWarning('Test name',false);

if(getValue('antigen')){
testName='Antigen';}
if(getValue('pcr')){
testName='PCR';
patientInfo='Address\n';
if(!isCharactersValid('Apt #', '')){fieldsFilled=false;}else{patientInfo=patientInfo+'Apt # '+getFieldText('Apt #').replace(',',' ')+'\n';}
if(!isCharactersValid('House #', '')){fieldsFilled=false;}else{patientInfo=patientInfo+'House # '+getFieldText('House #').replace(',',' ')+'\n';}
if(!isCharactersValid('Street name','')){fieldsFilled=false;}else{patientInfo=patientInfo+getFieldText('Street name').replace(',',' ')+'\n';}
if(!isCharactersValid('City','')){fieldsFilled=false;}else{patientInfo=patientInfo+getFieldText('City').replace(',',' ')+'\n';}
if(!isCharactersValid('Island','')){fieldsFilled=false;}else{patientInfo=patientInfo+getFieldText('Island').replace(',',' ')+'\n';}
if(!isCharactersValid('Country','')){fieldsFilled=false;}else{patientInfo=patientInfo+getFieldText('Country').replace(',',' ')+'\n';}


if(!getValue('passport')&&!getValue('nib')){
setWarning('Government ID',true);
fieldsFilled=false;
}else{
setWarning('Government ID',false);
patientInfo=patientInfo+'\nGovernment ID\n';

if(getValue('passport')){
if(!isCharactersValid('ID Number', '')){fieldsFilled=false;}else{patientInfo=patientInfo+'Passport # '+getFieldText('ID Number')+'\n';}}
if(getValue('nib')){
if(!isCharactersValid('ID Number', '')){fieldsFilled=false;}else{patientInfo=patientInfo+'NIB # '+getFieldText('ID Number')+'\n';}}

patientInfo=patientInfo+'\nNationality\n';
if(!isCharactersValid('Nationality', 'alpha')){fieldsFilled=false;}else{patientInfo=patientInfo+getFieldText('Nationality')+'\n';}
}
}


}

if(!getValue('returnFromTravel')&&!getValue('forTravel')&&!getValue('re-entryIntoWorkspace')&&!getValue('work')&&!getValue('screening')&&!getValue('other')){
setWarning('Reason for testing',true);
fieldsFilled=false;
}else{
setWarning('Reason for testing',false);
if(getValue('pcr')){patientInfo=patientInfo+'\nReason for testing\n';
}else{
patientInfo=patientInfo+'Reason for testing\n';}
if(getValue('returnFromTravel')){patientInfo=patientInfo+'- Return from travel'+'\n';}
if(getValue('forTravel')){patientInfo=patientInfo+'- For travel'+'\n';}
if(getValue('re-entryIntoWorkspace')){patientInfo=patientInfo+'- Re-entry into workspace'+'\n';}
if(getValue('work')){patientInfo=patientInfo+'- Work'+'\n';}
if(getValue('screening')){patientInfo=patientInfo+'- Screening'+'\n';}
if(getValue('other')){patientInfo=patientInfo+'- Other'+'\n';}

}


setWarning('Onset date|monthField',false);
setWarning('Onset date|dayField',false);
setWarning('Onset date|yearField',false);
setWarning('Symptoms',false);
if(!getValue('yes')&&!getValue('no')){
setWarning('COVID-19 symptoms (last 14 days)',true);
fieldsFilled=false;
}else{
setWarning('COVID-19 symptoms (last 14 days)',false);
patientInfo=patientInfo+'\nCOVID-19 symptoms (last 14 days)\n';

if(!getValue('abdominalPain')&&!getValue('chills')&&!getValue('diarrhea')&&!getValue('dryCough')&&!getValue('fatigue')&&!getValue('fever')&&!getValue('headache')&&!getValue('myalgia')&&!getValue('lossOfTaste')&&!getValue('lossOfSmell')&&!getValue('shortnessOfBreath')&&!getValue('vomiting')&&getValue('yes')){
setWarning('Symptoms',true);
fieldsFilled=false;
}else{
setWarning('Symptoms',false);
if(getValue('no')){
patientInfo=patientInfo+'-NA-\n';}
}

if(getValue('yes')){
isCharactersValid('Onset date|monthField','numeric');
isCharactersValid('Onset date|dayField','numeric');
isCharactersValid('Onset date|yearField','numeric');

if(getValue('abdominalPain')){patientInfo=patientInfo+'- Abdominal Pain'+'\n';}
if(getValue('chills')){patientInfo=patientInfo+'- Chills'+'\n';}
if(getValue('diarrhea')){patientInfo=patientInfo+'- Diarrhea'+'\n';}
if(getValue('dryCough')){patientInfo=patientInfo+'- Dry Cough'+'\n';}
if(getValue('fatigue')){patientInfo=patientInfo+'- Fatigue'+'\n';}
if(getValue('fever')){patientInfo=patientInfo+'- Fever'+'\n';}
if(getValue('headache')){patientInfo=patientInfo+'- Headache'+'\n';}
if(getValue('myalgia')){patientInfo=patientInfo+'- Myalgia'+'\n';}
if(getValue('lossOfTaste')){patientInfo=patientInfo+'- Loss of taste'+'\n';}
if(getValue('lossOfSmell')){patientInfo=patientInfo+'- Loss of smell'+'\n';}
if(getValue('shortnessOfBreath')){patientInfo=patientInfo+'- Shortness of breath'+'\n';}
if(getValue('vomiting')){patientInfo=patientInfo+'- Vomiting'+'\n';}

patientInfo=patientInfo+'\nSymptom onset date\n';
patientInfo=patientInfo+getFieldText('Onset date|monthField')+'/'+getFieldText('Onset date|dayField')+'/'+getFieldText('Onset date|yearField')+'\n';}
}

setWarning('Contact date|monthField',false);
setWarning('Contact date|dayField',false);
setWarning('Contact date|yearField',false);
setWarning('Contact with known case',false);
if(!getValue('contactYes')&&!getValue('contactNo')){
setWarning('Contact with known case',true);
fieldsFilled=false;
}else{
setWarning('Contact with known case',false);
patientInfo=patientInfo+'\nExposure date with known positive case\n';

if(getValue('contactYes')){
isCharactersValid('Contact date|monthField','numeric');
isCharactersValid('Contact date|dayField','numeric');
isCharactersValid('Contact date|yearField','numeric');
patientInfo=patientInfo+getFieldText('Contact date|monthField')+'/'+getFieldText('Contact date|dayField')+'/'+getFieldText('Contact date|yearField')+'\n';
}else{
patientInfo=patientInfo+'-NA-\n';}
}

if(!getValue('notVaccinated')&&!getValue('partiallyVaccinated')&&!getValue('fullyVaccinated')){
setWarning('COVID-19 Vaccination Status',true);
fieldsFilled=false;
}else{
setWarning('COVID-19 Vaccination Status',false);
patientInfo=patientInfo+'\nCOVID-19 Vaccination Status\n';
if(getValue('notVaccinated')){
patientInfo=patientInfo+'Not vaccinated\n';
}
if(getValue('partiallyVaccinated')){
patientInfo=patientInfo+'Partially vaccinated\n';
}
if(getValue('fullyVaccinated')){
patientInfo=patientInfo+'Fully vaccinated\n';
}

}
return fieldsFilled; }


function receiveDataFromGoogleSheets(){

waitForGoogleThenExecute();

if(getDataFromGoogleSheetsAsArray()[0]=='registrationSuccessful'){
displayUi('uI', "<div style= 'margin: auto; width:300px;' ><div><img src='accessMedicalLogo.png' width=250></div><hr><h3>Thank You</h3><h4 >Please proceed to the testing area.</h4></div>");
}

if(getDataFromGoogleSheetsAsArray()[0]=='invalidId'){
displayUi('status','Invalid Identification number');
setEnabled('submitButtonGuiForm',true);
}

if(getDataFromGoogleSheetsAsArray()[0]=='archiving'){
displayUi('status',"Service temporary unavailable");
}

}

function onClickCheckbox(choice){
if(choice=='pcr'&&getValue(choice)==true){
setValue('antigen',false);
}
if(choice=='antigen'&&getValue(choice)==true){
setValue('pcr',false);
}

if(choice=='passport'&&getValue(choice)==true){
setValue('nib',false);
}
if(choice=='nib'&&getValue(choice)==true){
setValue('passport',false);
}


if(choice=='yes'&&getValue(choice)==true){
setValue('no',false);
}
if(choice=='no'&&getValue(choice)==true){
setValue('yes',false);
}

if(choice=='contactYes'&&getValue(choice)==true){
setValue('contactNo',false);
}
if(choice=='contactNo'&&getValue(choice)==true){
setValue('contactYes',false);
}

if(choice=='notVaccinated'&&getValue(choice)==true){
setValue('partiallyVaccinated',false);
setValue('fullyVaccinated',false);
}
if(choice=='partiallyVaccinated'&&getValue(choice)==true){
setValue('notVaccinated',false);
setValue('fullyVaccinated',false);
}
if(choice=='fullyVaccinated'&&getValue(choice)==true){
setValue('partiallyVaccinated',false);
setValue('notVaccinated',false);
}
setPCRInfoEnabled(getValue('pcr'));
setSymptomInfoEnabled(getValue('yes'));
setExposureInfoEnabled(getValue('contactYes'));
}

function waitForGoogleThenExecute(){
try{displayUi('status','');
setEnabled('pcr',true);
setEnabled('antigen',true);
if(getValue('antigen')==true||getValue('pcr')==true){
setEnabled('setPaymentOption',true);}
}catch(err){
}
}


function setPaymentFunction(){
}

function setPCRInfoEnabled(enable){
setEnabled('Address',enable);
setEnabled('Apt #',enable);
setEnabled('House #',enable);
setEnabled('Street name',enable);
setEnabled('City',enable);
setEnabled('Island',enable);
setEnabled('Country',enable);
setEnabled('Government ID',enable);
setEnabled('passport',enable);
setEnabled('nib',enable);
setEnabled('ID Number',enable);
setEnabled('Nationality',enable);
}

function setSymptomInfoEnabled(enable){
setEnabled('abdominalPain',enable);
setEnabled('chills',enable);
setEnabled('diarrhea',enable);
setEnabled('dryCough',enable);
setEnabled('fatigue',enable);
setEnabled('fever',enable);
setEnabled('headache',enable);
setEnabled('myalgia',enable);
setEnabled('lossOfTaste',enable);
setEnabled('lossOfSmell',enable);
setEnabled('shortnessOfBreath',enable);
setEnabled('vomiting',enable);
setEnabled('Onset date|monthField',enable);
setEnabled('Onset date|dayField',enable);
setEnabled('Onset date|yearField',enable);
}

function setExposureInfoEnabled(enable){
setEnabled('Contact date|monthField',enable);
setEnabled('Contact date|dayField',enable);
setEnabled('Contact date|yearField',enable);
}


</script>

</html>