tvman495
Joined: 27 Apr 2010
Posts: 1
|
Posted:
Tue Apr 27, 2010 1:27 pm Post subject:
Drafix Macro |
|
|
Hi,
I need hep understanding the Drafix Macro Below. I can't understand where the "patientdetails" is beign pulled from .
Any ideas ???
// Transfers existing patient data from "patientdetails"
// and existing workorder details from common symbols.
// The VB programme can then load the TXF
// and intellegently deal with problems
Display ("cursor", "wait", "Loading Data");
HANDLE
hChan,
hSym,
hDDE,
hEnt;
XY
xySymO,
xyScale;
ANGLE
aAngle;
STRING
sSymName,
sSymSelection,
sPathJOBST,
sWorkOrder,
sWO_TXF,
sCurrentCADFile,
sInitialCADFile,
// Strings are initialized to empty "", this ensures empty strings
// are poked if there is no DB field.
s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s20, s30, s40, s50, s60, s70;
// Start the application and get DDE link
// Find JOB installed directory
//
sPathJOB = GetProfileString("JOB", "PathJOB", "\\JOB", "DRAFIX.INI") ;
Execute ("application", sPathJOB + "\\CADLINK\\CLTXFDIA", "normal");
hDDE = Open ("dde", "cltxfdia", "cltxfdia");
if ( !hDDE) Exit (%abort, "Unable to open \"cltxfdia\" dialogue!") ;
// Get all of the symbols for uploading
//
sSymSelection = "DB SymbolName = 'patientdetails'" ;
hChan = Open ("selection", sSymSelection );
if (hChan && hDDE ) {
ResetSelection(hChan);
// Get Triton eXchange File and Work Order
//
Poke ( hDDE, "txtInvokedFrom", "imageABLE");
GetData ( "UserChar1", &sWO_TXF); // TXF File
Poke ( hDDE, "txtWO_TXF", sWO_TXF);
GetData ( "UserChar2", &sWorkOrder); // Work order
Poke ( hDDE, "txtWorkOrder", sWorkOrder);
GetData ( "UserChar3", &sInitialCADFile ); // The CAD file the Drawing will
Poke ( hDDE, "txtInitialCADFile", sInitialCADFile );// be based on or "NEW" or "INSPECTION"
GetData ("DocFile", &sCurrentCADFile); // The current cad file
Poke ( hDDE, "txtCurrentCADFile", sCurrentCADFile );
// Get Symbol data base fields
//
while (hSym = GetNextSelection(hChan)) {
GetGeometry(hSym, &sSymName, &xySymO, &xyScale, &aAngle);
if(StringCompare(sSymName, "patientdetails" )){
GetDBData( hSym, "fileno", &s1); Poke ( hDDE, "txtFileNo", s1);
GetDBData( hSym, "patient", &s2); Poke ( hDDE, "txtPatientName", s2);
GetDBData( hSym, "age", &s3); Poke ( hDDE, "txtAge", s3);
GetDBData( hSym, "units", &s4); Poke ( hDDE, "txtUnits",s4);
GetDBData( hSym, "sex", &s5); Poke ( hDDE, "txtSex",s5);
GetDBData( hSym, "Diagnosis", &s6); Poke ( hDDE, "txtDiagnosis", s6);
GetDBData( hSym, "WorkOrder", &s7); Poke ( hDDE, "txtMPDwo",s7);
GetDBData( hSym, "orderdate", &s ; Poke ( hDDE, "txtOrderDate",s ;
GetDBData( hSym, "TemplateEngineer", &s9); Poke ( hDDE, "txtTemplateEngineer",s9);
Poke ( hDDE, "txtUidMPD", MakeString("long",UID("get",hSym)));
}
}
}
Close ( "selection", hChan);
Close ( "dde", hDDE);
Exit (%ok, "Patient and Work Order Details transfered");
|
|