web stats
Database Writer Using Javascript w(functions and sequences) - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Reply
 
Thread Tools Display Modes
  #1  
Old 06-06-2014, 07:39 AM
blbrashear blbrashear is offline
Mirth Newb
 
Join Date: Nov 2013
Posts: 17
blbrashear is on a distinguished road
Default Database Writer Using Javascript w(functions and sequences)

We are new to Mirth and are using an Appliance. The version of MirthConnect is 3.0.2.7140 and soon to upgrade to 3.0.3 because the appliance will auto update as the information reads.

I have a database writer where I'm using SQL, but I would like to use javascript if possible. Here is what I'm using to insert into an Oracle database:

INSERT INTO PATIENTS (ID, OFFICE, FIRSTNAME, LASTNAME, MIDDLENAME, GENDER, BIRTHDATE, DATE_FORMAT, SOURCEID, STREET1, CITY, STATE, POSTCODE, HOMEPHONE, WORKPHONE, NOTES, PHYSICIAN_DEA, PHYSICIAN_FIRSTNAME, PHYSICIAN_LASTNAME, INSURANCE_STRING, MEMBER_ID_NUMBER, GROUP_NUMBER, RELATIONSHIP_CODE, APPT_DATE, APPT_DATE_FORMAT)

VALUES (SEQ_PATIENTS.NEXTVAL, FNC_GET_IIDOFFICE(${thischannelName}, ${patientVisit_assignedPatientLocation_pointOfCare }),

${patientIdentification_patientName_givenName},
${patientIdentification_patientName_familyName},
${patientIdentification_patientName_middleInitialO rName},
${patientIdentification_sex_value},
${patientIdentification_dateOrTimeOfBirth_value},
'YYYY-MM-DD',
${patientIdentification_patientIdExternalId_id},
${patientIdentification_patientAddress_streetAddre ss},
${patientIdentification_patientAddress_city},
${patientIdentification_patientAddress_stateOrProv ince},
${patientIdentification_patientAddress_zipOrPostal Code},
${patientIdentification_phoneNumber_home_number},
${patientIdentification_phoneNumber_business_numbe r},
${patientVisit_visitNumber_id},
FNC_GET_PRESCRIBER_DEA_NPI(${thischannelName}, ${patientVisit_attendingDoctor_idNumber}, 'DEA'),
${patientVisit_attendingDoctor_givenName},
${patientVisit_attendingDoctor_familyName},
${insurance0_insuranceCompanyName_organizationName },
${insurance0_policyNumber_value},
${insurance0_groupNumber_value},
${insurance0_insuredsRelationshipToPatient_value},
${patientVisit_admitDateOrTime_value},
'YYYY-MM-DD'
)

Can someone help with translating the function and sequence statements (bolded above) using the correct syntax for javascript? I am having trouble figuring out the seq.nextval and the function. $('SEQ.PATIENTS.NEXTVAL') + "','" + (FNC_GET_OFFICE(${thischannelName}).
I'm having trouble with the syntax.

Thank you for your help please and thank you again.

Sincerely,
Not Knowing and
Reply With Quote
Reply

Tags
database writer, functions, javascript, sequences

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 06:50 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2019, vBulletin Solutions, Inc.
Mirth Corporation