I created this script to create an xml file:
dim ndx as p
dim tbl as p
tbl=table.open("[pathalias.adb_path]\patients")
query.filter="idnumber='"+session.idnumber+"'"+".and. pracid='"+session.pracid+"'"
query.order=""
query.options=""
ndx=tbl.query_create()
dim fname as c
fname="c:\patient_add.xml"
dim tmerchantid as c
tmerchantid="3128382"
dim tmerchantkey as c
tmerchantkey="0000382832"
dim fp as p
fp=file.create(fname,FILE_RW_EXCLUSIVE)
fp.write_line("<api-request>")
fp.write_line(" <verification>")
fp.write_line(" <merchantId>"+alltrim(tmerchantkey)+"</merchantId>")
fp.write_line(" <merchantKey>"+alltrim(tmerchantkey)+"</merchantKey>")
fp.write_line(" </verification>")
fp.write_line(" <command>add-patient</command>")
fp.write_line("")
fp.write_line("")
fp.write_line(" <request>")
fp.write_line(" <patientAccountNumber>"+alltrim(tbl.idnumber)+"</patientAccountNumber>")
fp.write_line(" <firstName>"+alltrim(tbl.Firstname)+"</firstName>")
fp.write_line(" <middleName>"+alltrim(tbl.Middle)+"</middleName>")
fp.write_line(" <lastName>"+alltrim(tbl.lastname)+"</lastName>")
fp.write_line(" <address1>"+alltrim(tbl.address1)+"</address1>")
fp.write_line(" <address2>"+alltrim(tbl.address2)+"</address2>")
fp.write_line(" <city>"+alltrim(tbl.city)+"</city>")
fp.write_line(" <state>"+alltrim(tbl.state)+"</state>")
fp.write_line(" <zip>"+alltrim(tbl.zip)+"</zip>")
fp.write_line(" <phone>"+alltrim(tbl.Homephone)+"</phone>")
fp.write_line(" <email>"+alltrim(tbl.E_mail)+"</email>")
fp.write_line(" <dob>"+dtoc(tbl.dob)+"</dob>")
fp.write_line(" <ssn>"+alltrim(tbl.Socsec)+"</ssn>")
fp.write_line(" <sex>"+left(alltrim(tbl.sex),1)+"</sex>")
fp.write_line(" <medicalRecordNumber>"+"</<medicalRecordNumber>>")
fp.write_line(" <familyAccountNumber>"+"</familyAccountNumber>")
dim ndx1 as p
dim tbl1 as p
tbl1=table.open("[pathalias.adb_path]\primaryinsur")
query.filter="idnumber='"+session.idnumber+"'"+".and. pracid='"+session.pracid+"'"+".and. i1insconame='"+tbl.I1insconame+"'"
query.order=""
query.options=""
ndx1=tbl1.query_create()
dim tpolicynumber as c
tpolicynumber=tbl1.i1insdid
dim tgroupnumber as c
tgroupnumber=tbl1.I1insdgrp
dim ti1ptrel as c
ti1ptrel=tbl1.I1ptrel
ndx1.drop()
tbl1.close()
fp.write_line(" <policyNumber>"+alltrim(tpolicynumber)+"</policyNumber>")
fp.write_line(" <groupNumber>"+alltrim(tgroupnumber)+"</groupNumber>")
fp.write_line(" <relationshipType>"+alltrim(ti1ptrel)+"</relationshipType>")
fp.write_line(" <alternateMemberIdType>"+"</alternateMemberIdType>")
fp.write_line(" <alternateMemberId>"+"</alternateMemberId>")
fp.write_line(" <payerProgramName>"+alltrim(tbl.Firstname)+"</payerProgramName>")
fp.write_line(" </request>")
fp.write_line("</api-request>")
fp.flush()
fp.close()
ndx.drop()
tbl.close()
I have the url I need to post this to, but how in the heck do I do that, i.e. how do I post this xml file to the url???
Lost ....
dim ndx as p
dim tbl as p
tbl=table.open("[pathalias.adb_path]\patients")
query.filter="idnumber='"+session.idnumber+"'"+".and. pracid='"+session.pracid+"'"
query.order=""
query.options=""
ndx=tbl.query_create()
dim fname as c
fname="c:\patient_add.xml"
dim tmerchantid as c
tmerchantid="3128382"
dim tmerchantkey as c
tmerchantkey="0000382832"
dim fp as p
fp=file.create(fname,FILE_RW_EXCLUSIVE)
fp.write_line("<api-request>")
fp.write_line(" <verification>")
fp.write_line(" <merchantId>"+alltrim(tmerchantkey)+"</merchantId>")
fp.write_line(" <merchantKey>"+alltrim(tmerchantkey)+"</merchantKey>")
fp.write_line(" </verification>")
fp.write_line(" <command>add-patient</command>")
fp.write_line("")
fp.write_line("")
fp.write_line(" <request>")
fp.write_line(" <patientAccountNumber>"+alltrim(tbl.idnumber)+"</patientAccountNumber>")
fp.write_line(" <firstName>"+alltrim(tbl.Firstname)+"</firstName>")
fp.write_line(" <middleName>"+alltrim(tbl.Middle)+"</middleName>")
fp.write_line(" <lastName>"+alltrim(tbl.lastname)+"</lastName>")
fp.write_line(" <address1>"+alltrim(tbl.address1)+"</address1>")
fp.write_line(" <address2>"+alltrim(tbl.address2)+"</address2>")
fp.write_line(" <city>"+alltrim(tbl.city)+"</city>")
fp.write_line(" <state>"+alltrim(tbl.state)+"</state>")
fp.write_line(" <zip>"+alltrim(tbl.zip)+"</zip>")
fp.write_line(" <phone>"+alltrim(tbl.Homephone)+"</phone>")
fp.write_line(" <email>"+alltrim(tbl.E_mail)+"</email>")
fp.write_line(" <dob>"+dtoc(tbl.dob)+"</dob>")
fp.write_line(" <ssn>"+alltrim(tbl.Socsec)+"</ssn>")
fp.write_line(" <sex>"+left(alltrim(tbl.sex),1)+"</sex>")
fp.write_line(" <medicalRecordNumber>"+"</<medicalRecordNumber>>")
fp.write_line(" <familyAccountNumber>"+"</familyAccountNumber>")
dim ndx1 as p
dim tbl1 as p
tbl1=table.open("[pathalias.adb_path]\primaryinsur")
query.filter="idnumber='"+session.idnumber+"'"+".and. pracid='"+session.pracid+"'"+".and. i1insconame='"+tbl.I1insconame+"'"
query.order=""
query.options=""
ndx1=tbl1.query_create()
dim tpolicynumber as c
tpolicynumber=tbl1.i1insdid
dim tgroupnumber as c
tgroupnumber=tbl1.I1insdgrp
dim ti1ptrel as c
ti1ptrel=tbl1.I1ptrel
ndx1.drop()
tbl1.close()
fp.write_line(" <policyNumber>"+alltrim(tpolicynumber)+"</policyNumber>")
fp.write_line(" <groupNumber>"+alltrim(tgroupnumber)+"</groupNumber>")
fp.write_line(" <relationshipType>"+alltrim(ti1ptrel)+"</relationshipType>")
fp.write_line(" <alternateMemberIdType>"+"</alternateMemberIdType>")
fp.write_line(" <alternateMemberId>"+"</alternateMemberId>")
fp.write_line(" <payerProgramName>"+alltrim(tbl.Firstname)+"</payerProgramName>")
fp.write_line(" </request>")
fp.write_line("</api-request>")
fp.flush()
fp.close()
ndx.drop()
tbl.close()
I have the url I need to post this to, but how in the heck do I do that, i.e. how do I post this xml file to the url???
Lost ....
Comment