I work at a Surgery Center and have always been pretty tech savy, the I.T. person before me set up everything in planet press. This program while very powerful to the uneducated user makes me cringe whenever I get a request to make a changes.
In planetpress design we have a packet called Patient Demographics and I have a request to print this sheet multiple times for only certain surgery cases. In this sheet we have tons of data selections ranging from date to surgeon, surgery, type of service, ect. First things first I am not sure if this is something I set in Design or in Office. I am guessing since these are variable fields that change constantly this is something I would need to program in Office.
In Office we have a subprocess called SendToDatabase
this subprocess has Begin Sub->Set Job Infos and Variables %{patientID} = @(1,3,3,43,64,KeepCase,Trim)
%{patientName} = @(1,3,3,3,42,KeepCase,Trim)
%{dateOfService} = @(1,3,3,65,74,KeepCase,Trim)
%{typeOfService} = @(2,24,24,109,112,KeepCase,Trim) -> '
First Problem is I think I have to add the variables of proposedSurgery, proposedSurgery2 to this section which I added to the script posted in the next section. I believe I have to do this in order to run a process with a true false statement to correctly identify which sheets to print twice. I have no clue how the previous guy added these because whenever I go to add them I only get these options or %1-%9. I also have been unable to trace where he is getting the locations for these "values" i.e. @(1,3,3,43,64,KeepCase,Trim)
Script for adding demographic info into MySQL database
OPTION EXPLICIT
Dim objDB, strSql, intRecordsAffected, adCmdText
Dim patientID, patientName, dateOfService, typeOfService
Dim accountID, proposedSurgery, proposedSurgery2
'Setup the database connection
Set objDB = CreateObject("ADODB.Connection")
objDB.Open("dsn=patient_demographics_odbc;Uid=patient_demographics_user;Pwd=$$$$$$$$$$$$$$$$$$$$$$$;")
'Get some variables from PlanetPress
patientID = watch.GetVariable("patientID")
patientName = watch.GetVariable("patientName")
dateOfService = watch.GetVariable("dateOfService")
typeOfService = watch.GetVariable("typeOfService")
proposedSurgery = watch.GetVariable("proposedSurgery")
proposedSurgery2 = watch.GetVariable("proposedSurgery2")
'SQL query & execution
strSql ="SET NOCOUNT ON; INSERT INTO demographics " &_
"(patientID, patientName, dateOfService, typeOfService, proposedSurgery, proposedSurgery2) " &_
"VALUES ('" & patientID & "', '" & patientName & "', '" & dateOfService & "', '" & typeOfService & "', '" & proposedSurgery & "', '" & proposedSurgery2 & "');" &_
" SELECT SCOPE_IDENTITY();"
accountID = objDB.Execute( strSql, intRecordsAffected, adCmdText )(0)
'Set the AccountID for PlanetPress
watch.SetVariable "accountID", accountID
I am a rookie to this program any help is very much appreciated.
Edited by YellowstoneSC (03/30/11 04:43 PM)