Hello,
I am trying to write a comprehensive CPS12 immunization form in VFE that populates the immunization with both the appropriate OBSTERMS and also pushes the immunization to the SQL Immunization Database using the IMMUN_ADD MEL Function.
I am receiving the following error code -9 (A data field could not be converted to a date/time) with my DOCUMENT.NAAC_FLU_VAC_DATE_ELSEWHERE.
Is there another way to format this Date variable into the IMMUN_ADD function so as not to receive the error code. I would appreciate any help from fellow CHUG programers. I have included a snippet of the effected code in my form.
Thank you in advance for any assistance
Jaisan
****************************************************************************
Problem code area
** form Button RUNPROCESS **
NAAC_IMM_ADD_TO_DATABASE("FLU VAX","Influenza - Unspecified Formulation [CVX88]","","N","Y","04 - Historical information - from parent's recall","","","","","","","","", DOCUMENT.NAAC_FLU_VAC_DATE_ELSEWHERE,"M","CVX88")
******* VFE White Space code Snippets ****************
/* function variables
aa - Vac Group (pos 1 required)
bb - Vacname (pos2 required)
cc - series (pos 4 optional)
dd - WasGiven (pos 5 (Y or N) required)
ee - historical (pos 7 (Y or N) required)
ff - historical source (pos 8 optional)
(pos 9 - V00 - VFCEligibilty not determined required by practice)
gg - administered dose (pos 16 optional)
hh - admin dose units (pos 17 optional)
ii - route (pos 18 optional)
jj - site (pos 20 optional)
kk - Manufacturer (pso 22 optional)
ll - Lot number (pos 24 optional)
mm - Expiratation date (pos 25 optional)
nn - Administered by (pos 27 optional)
oo - Admindate (pos 28 required)
pp - admindate type ( pos 29 (D, M OR Y) optional)
qq - CVXCode (pos 15 optional)
Usage in function
Historical = NAAC_IMM_ADD_TO_DATABASE(aa,bb,cc,dd,ee,ff,"","","","","","","","",oo,pp,qq)
administered = NAAC_IMM_ADD_TO_DATABASE(aa,bb,cc,dd,ee,ff,gg,hh,ii,jj,kk,ll,mm,nn,oo,pp,qq)
**** */
{fn NAAC_IMM_ADD_TO_DATABASE(aa,bb,cc,dd,ee,ff,gg,hh,ii,jj,kk,ll,mm,nn,oo,pp,qq)
{
if str(aa,bb,cc,dd,ee,ff,gg,hh,ii,jj,kk,ll,mm,nn,oo,pp,qq)="" then userok("No values entered") else
NAAC_IMM_ADD_Error( IMMUN_ADD("str(aa)^str(bb)^^str(cc)^str(dd)
^^str(ee)^str(ff)^V00^^^^^^ str(qq)^str(gg)^str(hh)^str(ii)^^str(jj)^^str(kk)^^str(ll)
^str(mm)^^str(nn)^str(oo)^str(pp)^^^^^^^^^")) endif
return ""
}}
{fn NAAC_IMM_ADD_Error(add){
if (add ="" or add="None") then
userok("Successfully added Historical Immunization to SQL database")
return ""
endif
cond
case (add == "-1") userok("Empty or missing immunization definition")
case (add == "-2") userok("VaccineGroupName not specified")
case (add == "-3") userok("WasGiven not specified")
case (add == "-5") userok("Historial not specified")
case (add == "-6") userok("VFCEligibility not specified")
case (add == "-7") userok("Database error occurred (this is often a field length issue")
case (add == "-8") userok("A numeric field could not be converted to a number")
case (add == "-9") userok("A data field could not be converted to a date/time")
case (add == "-10") userok("AdministerDate not specified")
case (add == "-17") userok("Null pointer could not be obtained")
case (add == "-18") userok("Clinical list lock could not be obtained")
case (add == "-19") userok("CVXCode not specified")
case (add == "-99") userok("An unknown error occurred")
else
userok("Unknown Error")
endcond
}}
Posted : March 22, 2015 4:49 pm