Personal tools
Navigation
 

Editor-For-BC.html v 0.9

This editor is like Editor-For-ON.html including template support and works in all versions of Oscar in any province. However it lacks referral letter support. Use this one if Editor-For-ON.html gives you the Oscar purple screen

HTML icon Editor-For-BC.html — HTML, 12 kB (12874 bytes)

File contents

<html><head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">

<title>Rich Text Letter</title>
<style type="text/css">
.butn {width: 140px;}
</style>

<style type="text/css" media="print">
.DoNotPrint {display: none;}

</style>

<script language="javascript">
var needToConfirm = false;

//keypress events trigger dirty flag for the iFrame and the subject line
document.onkeyup=setDirtyFlag


function setDirtyFlag() {
	needToConfirm = true; 
}

function releaseDirtyFlag() {
	needToConfirm = false; //Call this function if dosent requires an alert.
	//this could be called when save button is clicked
}


window.onbeforeunload = confirmExit;

function confirmExit() {
	if (needToConfirm)
	return "You have attempted to leave this page. If you have made any changes without clicking the Submit button, your changes will be lost. Are you sure you want to exit this page?";
}

</script>



</head><body onload="Start()" bgcolor="FFFFFF">


<!-- START OF EDITCONTROL CODE --> 

<script language="javascript" type="text/javascript" src="${oscar_image_path}editControl.js"></script>
      
<script language="javascript">

    //put any of the optional configuration variables that you want here
    cfg_width = '640';                    //editor control width in pixels
    cfg_height = '480';                   //editor control height in pixels
    cfg_editorname = 'edit';                //the handle for the editor                  
    cfg_isrc = '${oscar_image_path}';         //location of the button icon files
    cfg_filesrc = '${oscar_image_path}';         //location of the html files
    cfg_template = 'blank.html';	    //default style and content template
    cfg_formattemplate = '<option value="">&mdash; template &mdash;</option>  <option value="blank">blank</option>  <option value="consult">consult</option> <option value="certificate">work note</option> <option value="narcotic">narcotic contract</option> <option value="MissedAppointment">missed appt</option> <option value="custom">custom</option></select>';
    //cfg_layout = '[all]';             //adjust the format of the buttons here
    cfg_layout = 
'<table style="background-color:#ccccff; width:640px"><tr id=control1><td>[bold][italic][underlined]|[left][center][full][right]|[unordered][ordered][rule]|[undo][redo]|[indent][outdent][select-all][clean]|[clock][date][spell][help]</td></tr><tr id=control2><td>[select-block][select-face][select-size][select-template]</td></tr></table>[edit-area]';
    insertEditControl(); // Initialise the edit control and sets it at this point in the webpage

    function Start() {
        // set eventlistener for the iframe to flag changes in the text displayed 
	var agent=navigator.userAgent.toLowerCase(); //for non IE browsers
        if ((agent.indexOf("msie") == -1) || (agent.indexOf("opera") != -1)){
		document.getElementById(cfg_editorname).contentWindow.addEventListener('keypress',setDirtyFlag, true);
	}

        // reformat values of multiline database values from \n lines to <br>
        htmlLine('label');
        htmlLine('recent_rx');
        htmlLine('reminders');
        htmlLine('ongoingconcerns');
        htmlLine('medical_history');
        htmlLine('other_medications_history');  //family history  ... don't ask
        htmlLine('social_family_history');  //social history
        htmlLine('address');
        htmlLine('NameAddress');
        htmlLine('clinic_label');
        htmlLine('clinic_address');

	var gender=document.getElementById('sex').value; 
	if (gender=='F'){
		document.getElementById('he_she').value='she'; 
		document.getElementById('his_her').value='her';
		document.getElementById('gender').value='female';
	}


	document.getElementById('letterhead').value= genericLetterhead();

        // set the HTML contents of this edit control from the value saved in Oscar (if any)
	var contents=document.getElementById('Letter').value
	if (contents.length==0){
		parseTemplate();
	} else {
		seteditControlContents(cfg_editorname,contents);
	}
    }
 
    function htmlLine(theelement) { 
	var temp = new Array();
	if (document.getElementById(theelement).value.length>0){
		temp=document.getElementById(theelement).value.split('\n'); 
		contents='';
		var x;
		for (x in temp) {
			contents += temp[x]+'<br>';
			}
		document.getElementById(theelement).value=contents;
		}
    }

    function genericLetterhead() {
        // set the HTML contents of the letterhead
	var address = '<table border=0><tbody><tr><td><font size=6>'+document.getElementById('clinic_name').value+'</font></td></tr><tr><td><font size=2>'+ document.getElementById('clinic_addressLineFull').value+ ' Fax: '+document.getElementById('clinic_fax').value+' Phone: '+document.getElementById('clinic_phone').value+'</font><hr></td></tr></tbody></table><br>'
	return address;
    }


</script>

<!-- END OF EDITCONTROL CODE -->


<form method="post" action="" name="RichTextLetter" >

<!-- START OF DATABASE PLACEHOLDERS -->

<input type="hidden" name="clinic_name" id="clinic_name" oscarDB=clinic_name>
<input type="hidden" name="clinic_address" id="clinic_address" oscarDB=clinic_address>
<input type="hidden" name="clinic_addressLine" id="clinic_addressLine" oscarDB=clinic_addressLine>
<input type="hidden" name="clinic_addressLineFull" id="clinic_addressLineFull" oscarDB=clinic_addressLineFull>
<input type="hidden" name="clinic_label" id="clinic_label" oscarDB=clinic_label>
<input type="hidden" name="clinic_fax" id="clinic_fax" oscarDB=clinic_fax>
<input type="hidden" name="clinic_phone" id="clinic_phone" oscarDB=clinic_phone>
<input type="hidden" name="clinic_city" id="clinic_city" oscarDB=clinic_city>
<input type="hidden" name="clinic_province" id="clinic_province" oscarDB=clinic_province>
<input type="hidden" name="clinic_postal" id="clinic_postal" oscarDB=clinic_postal>

<input type="hidden" name="patient_name" id="patient_name" oscarDB=patient_name>
<input type="hidden" name="first_last_name" id="first_last_name" oscarDB=first_last_name>
<input type="hidden" name="patient_nameF" id="patient_nameF" oscarDB=patient_nameF >
<input type="hidden" name="patient_nameL" id="patient_nameL" oscarDB=patient_nameL >
<input type="hidden" name="label" id="label" oscarDB=label>
<input type="hidden" name="NameAddress" id="NameAddress" oscarDB=NameAddress>
<input type="hidden" name="address" id="address" oscarDB=address>
<input type="hidden" name="addressline" id="addressline" oscarDB=addressline>
<input type="hidden" name="phone" id="phone" oscarDB=phone>
<input type="hidden" name="phone2" id="phone2" oscarDB=phone2>
<input type="hidden" name="province" id="province" oscarDB=province>
<input type="hidden" name="city" id="city" oscarDB=city>
<input type="hidden" name="postal" id="postal" oscarDB=postal>
<input type="hidden" name="dob" id="dob" oscarDB=dob>
<input type="hidden" name="dobc" id="dobc" oscarDB=dobc>
<input type="hidden" name="dobc2" id="dobc2" oscarDB=dobc2>
<input type="hidden" name="hin" id="hin" oscarDB=hin>
<input type="hidden" name="hinc" id="hinc" oscarDB=hinc>
<input type="hidden" name="hinversion" id="hinversion" oscarDB=hinversion>
<input type="hidden" name="ageComplex" id="ageComplex" oscarDB=ageComplex >
<input type="hidden" name="age" id="age" oscarDB=age >
<input type="hidden" name="sex" id="sex" oscarDB=sex >

<input type="hidden" name="medical_history" id="medical_history" oscarDB=medical_history>
<input type="hidden" name="recent_rx" id="recent_rx" oscarDB=recent_rx>
<input type="hidden" name="social_family_history" id="social_family_history" oscarDB=social_family_history>
<input type="hidden" name="other_medications_history" id="other_medications_history" oscarDB=other_medications_history>
<input type="hidden" name="reminders" id="reminders" oscarDB=reminders>
<input type="hidden" name="ongoingconcerns" id="ongoingconcerns" oscarDB=ongoingconcerns >

<input type="hidden" name="provider_name_first_init" id="provider_name_first_init" oscarDB=provider_name_first_init >
<input type="hidden" name="current_user" id="current_user" oscarDB=current_user >
<input type="hidden" name="doctor_work_phone" id="doctor_work_phone" oscarDB=doctor_work_phone >
<input type="hidden" name="doctor" id="doctor" oscarDB=doctor >

<input type="hidden" name="today" id="today" oscarDB=today>

<!-- PLACE REFERRAL PLACEHOLDERS HERE WHEN BC APCONFIG FIXED -->

<!-- END OF DATABASE PLACEHOLDERS -->

<!-- START OF DERIVED PLACEHOLDERS -->

<input type="hidden" name="he_she" id="he_she" value="he">
<input type="hidden" name="his_her" id="his_her" value="his">
<input type="hidden" name="gender" id="gender" value="male">
<input type="hidden" name="referral_nameL" id="referral_nameL" value="Last Name of Referring Doctor">
<input type="hidden" name="letterhead" id="letterhead" value="Letterhead">

<!-- END OF DERIVED PLACEHOLDERS -->


<textarea name="Letter" id="Letter" style="width:600px; display: none;"></textarea>

<div class="DoNotPrint" id="control3" style="position:absolute; top:50px; left: 660px;">
<input type="button" class="butn" name="AddLetterhead" id="AddLetterhead" value="Letterhead" 
	onclick="doHtml(document.getElementById('letterhead').value);">

<br>

<input type="button" class="butn" name="AddReferral" id="AddReferral" value="Referring Block" 
	onclick="doHtml(document.getElementById('referral_name').value+'<br>'+ document.getElementById('referral_address').value +'<br>CANADA<br> Tel: '+ document.getElementById('referral_phone').value+'<br>Fax:  '+document.getElementById('referral_fax').value);">

<br>

<input type="button" class="butn" name="AddLabel" id="AddLabel" value="Patient Block" 
	onclick="doHtml(document.getElementById('label').value);">

<br>

<br>
<input type="button"  class="butn" name="MedicalHistory" value="Recent History" width=30
	onclick="var hist=parseText(document.getElementById('medical_history').value); doHtml(hist);">
<br>
<input type="button"  class="butn" name="AddMedicalHistory" value="Full History" width=30
	onclick="doHtml(document.getElementById('medical_history').value); ">

<br>
<input type="button" class="butn" name="OtherMedicationsHistory" value="Family History"
	onclick="var hist=parseText(document.getElementById('other_medications_history').value); doHtml(hist);">
<br>
<input type="button" class="butn" name="AddOtherMedicationsHistory" value="Full Family Hx"
	onclick="doHtml(document.getElementById('other_medications_history').value); ">

<br>
<input type="button" class="butn" name="AddSocialFamilyHistory" value="Social History" 
	onclick="var hist=parseText(document.getElementById('social_family_history').value); doHtml(hist);">
<br>
<input type="button" class="butn" name="AddReminders" value="Reminders"
	onclick="var hist=parseText(document.getElementById('reminders').value); doHtml(hist);">
<br>
<input type="button" class="butn" name="AddOngoingConcerns" value="Ongoing Concerns"
	onclick="var hist=parseText(document.getElementById('ongoingconcerns').value); doHtml(hist);">
<br>
<br>
<input type="button" class="butn" name="Patient" value="Patient Name"
	onclick=" doHtml(document.getElementById('first_last_name').value);">

<br>
<input type="button" class="butn" name="PatientAge" value="Patient Age"
	onclick="var hist=document.getElementById('ageComplex').value; if (hist==''){hist=document.getElementById('age').value;}; doHtml(hist);">
<br>
<input type="button" class="butn" name="label" value="Patient Label"
	onclick="var hist=document.getElementById('label').value; doHtml(hist);">


<br>
<input type="button" class="butn" name="PatientSex" value="Patient Gender"
	onclick="doHtml(document.getElementById('sex').value);">
<br>
<br>
<input type="button" class="butn" name="Closing" value="Closing Salutation" 
	onclick=" doHtml('<p>Yours Sincerely<p>&nbsp;<p>'+ document.getElementById('provider_name_first_init').value+', MD');">
 
<br>
<input type="button" class="butn" name="User" value="Current User"
	onclick="var hist=document.getElementById('current_user').value; doHtml(hist);">
 
<br>
<input type="button" class="butn" name="Doctor" value="Attending Doctor"
	onclick="var hist=document.getElementById('doctor').value; doHtml(hist);">
<br>
<br>


<br>
</div>


<div class="DoNotPrint" >
<input onclick="viewsource(this.checked)" type="checkbox">
HTML Source
<input checked="checked" onclick="usecss(this.checked)" type="checkbox">
Use CSS
	<table><tr><td>
		 Subject: <input name="subject" size="40" type="text">
		 <input value="Submit" name="SubmitButton" type="button" onClick="releaseDirtyFlag(); document.getElementById('Letter').value=editControlContents('edit');  document.RichTextLetter.submit()">
		 <input value="Reset" name="ResetButton" type="button" onClick="Start();">
		 <input value="Print" name="PrintButton" type="button" onclick="document.getElementById('edit').contentWindow.print();">	 
	</td></tr></table>
 </div>
 </form>

</body></html>


Document Actions

 

Download button

DOWNLOAD OSCAR FOR TESTING

 

eForms button

DOWNLOAD SHARED E-FORMS


 Customize button

FIND PLUG-INS AND TWEAKS
FOR YOUR OSCAR EMR

 

Subscribe Button

SUBSCRIBE TO DISCUSSION LIST 
(SEE ALL LISTS)

  

Help button

ACCESS THE ONLINE MANUALS
(PAID SUPPORT)