42. EPMO Open Source Coordination Office Redaction File Detail Report

Produced by Araxis Merge on 3/31/2017 10:45:43 AM Central Daylight Time. See www.araxis.com for information about Merge. This report uses XHTML and CSS2, and is best viewed with a modern standards-compliant browser. For optimum results when printing this report, use landscape orientation and enable printing of background images and colours in your browser.

42.1 Files compared

# Location File Last Modified
1 CPRS v31A.zip\CPRS v31A\VITL5_P34_src.zip\Source\VITALSUTILS uGMV_Engine.pas Tue Dec 13 18:26:08 2016 UTC
2 CPRS v31A.zip\CPRS v31A\VITL5_P34_src.zip\Source\VITALSUTILS uGMV_Engine.pas Fri Mar 31 15:32:45 2017 UTC

42.2 Comparison summary

Description Between
Files 1 and 2
Text Blocks Lines
Unchanged 2 1988
Changed 1 2
Inserted 0 0
Removed 0 0

42.3 Comparison options

Whitespace
Character case Differences in character case are significant
Line endings Differences in line endings (CR and LF characters) are ignored
CR/LF characters Not shown in the comparison detail

42.4 Active regular expressions

No regular expressions were active.

42.5 Comparison detail

  1   unit uGMV_ Engine;
  2   {
  3   ========== ========== ========== ========== ========== ========== ========== ==========
  4   *
  5   *       Ap plication:   Vitals
  6   *       Re vision:      $Revisio n: 1 $  $M odtime: 5/ 05/09 1:44 p $
  7   *       De veloper:      PII                          
  8   *       Si te:          Hines OI FO
  9   *
  10   *       De scription:   This uni t isolates  VistA RPC
  11   *
  12   *       No tes:
  13   *
  14   ========== ========== ========== ========== ========== ========== ========== ==========
  15   *       $A rchive: /V itals/5.0  (Version 5 .0)/5.0.23  (Patch 23 )/VITALS_5 _0_23_8/So urce/VITAL SUTILS/uGM V_Engine.p as $
  16   *
  17   *       $  History: u GMV_Engine .pas $
  18   *
  19   *       20 07-07-12,1 6,17 vhais handria
  20   *                Para meter veri fication
  21   *                Form atting of  the source  code
  22   }
  23   interface
  24  
  25   uses
  26   {$IFDEF RE DIRECTOR}
  27     uHEVDR_P Call
  28   {$ELSE}
  29     fROR_PCa ll
  30   {$ENDIF}
  31     , Classe s
  32     , SysUti ls
  33     ;
  34   function g etStationI nfo: strin g;
  35   function g etEXEInfo( anEXEName:  string):  string;
  36   function g etDLLInfo( anEXEName:  string):  string;
  37   function g etALLPatie ntData(aPa tient, aFr om, aTo: s tring): TS tringList;
  38  
  39   // Date an d Time
  40   function g etCurrentD ateTime: s tring; //  uGMV_DateT ime
  41   function c onvertMDat e(aValue:  string): s tring; //  uGMVMDateT ime
  42   function g etServerWD ateTime: T DateTime;
  43   function g etServerWD elay: TDat eTime;
  44   function g etServerWD ateTimeStr ing: strin g;
  45  
  46   function g etUserPara meter: str ing; // uG MV_User
  47   function g etUserSign OnInfo: TS tringList;
  48   function g etUserSett ings(aName : string):  string;
  49   function s etUserSett ings(aName , aValue:  string): s tring;
  50   function g etUserDUZS tring: str ing;
  51  
  52   // System  parameters
  53   function g etSystemPa rameterByN ame(aName:  string):  string; //  fGMV_Mana ger
  54   function g etWebLinkA ddress: st ring;
  55  
  56   // Qualifi ers
  57   function g etVitalQua lifierList (aVital: s tring): TS tringList;  // fGMV_Q ualifiers
  58   function g etQualifie rs(aVital,  aCategory : string):  TStringLi st; // uGM V_QualifyB ox
  59   function g etCategory Qualifiers (aVital: s tring): TS tringList;  // mGMV_E ditTemplat e
  60  
  61   function a ddQualifie r(aVitalID , aCategor yID, aQual ifierID: s tring): st ring;
  62   function d elQualifie r(aVitalID , aCategor yID, aQual ifierID: s tring): st ring;
  63   function a ddNewQuali fier(aName : string):  string;
  64  
  65   function v alidateQua lifierName (aFDD, aIE N, aField,  aName: st ring): str ing;
  66   function s etQualifie rName(aFDD , aIEN, aF ield, aNam e: string) : string;
  67  
  68   //Patients
  69   {$IFNDEF D LL}
  70   function g etPatientL ist(aTarge t: string) : TStringL ist;
  71   {$ENDIF}
  72   // Files a nd Fields
  73   function g etFileEntr ies(aFile:  string):  TStringLis t; // uGMV _FileEntry
  74   function g etFileFiel d(aFile, a Field, anI EN: string ): string;
  75  
  76   // Vitals
  77   function g etVitalsID List: TStr ingList;
  78  
  79   function g etVitalTyp eIEN(aVita l: string) : string;  // fGMV_Su pO2
  80   function g etVitalCat egoryIEN(a Category:  string): s tring;
  81  
  82   function g etTemplate List: TStr ingList; / / fGMV_Inp utTemp
  83   function a ddVM(aValu e: string) : string;
  84  
  85   function g etPatientI nfo(aPatie nt: string ): TString List;
  86   function g etPatientH eader(aPat ient: stri ng): TStri ngList;
  87   //procedur e logPatie ntAccess(a Patient:St ring);// f GMV_PtSele ct
  88   function l ogPatientA ccess(aPat ient: stri ng): strin g;
  89  
  90   function g etNursingU nitPatient s(aUnit: s tring): TS tringList;  // mGMV_P tLookup
  91   function g etWardPati ents(aWard : string):  TStringLi st;
  92   function g etTeamPati ents(aTeam : string):  TStringLi st;
  93   function g etClinicPa tients(aCl inic, aDat e: string) : TStringL ist;
  94  
  95   function g etLookupEn tries(aFil e, aTarget : string):  TStringLi st; // mGM V_Lookup
  96  
  97   function n ewTemplate (aCategory , aName, a Value: str ing): stri ng;
  98  
  99   procedure  setTemplat e(anID, aN ame, aValu e: string) ;
  100   function r enameTempl ate(anID,  aName, aNe wName: str ing): stri ng;
  101   function g etTemplate Value(anID , aName: s tring): st ring;
  102   function s etDefaultT emplate(an ID, aName:  string):  string;
  103   function g etDefaultT emplateByI D(anID: st ring): str ing;
  104   function g etDefaultT emplateLis t: TString List;
  105   function g etTemplate ListByID(a nID: strin g): TStrin gList;
  106   function c reateUserT emplateByN ame(aName:  string):  string;
  107   function d eleteUserT emplate(aN ame: strin g): string ;
  108  
  109   function d eleteTempl ate(aCateg ory, aName : string):  string;
  110  
  111   function c reateConte xt(aContex t: string) : Boolean;  // uGMV_U ser
  112   function E ngineReady : Boolean;
  113  
  114   function g etLatestVi talsByDFN( aDFN: stri ng; aSilen t: Boolean ): TString List;
  115   function g etHospital LocationBy ID(anID: s tring): st ring;
  116   function g etWardLoca tions(anOp tion: stri ng = ''):  TStringLis t;
  117   function g etRoomBedB yWard(aWar d: string) : TStringL ist;
  118  
  119   function g etProcedur eResult(aP roc, aPara m: string) : string;
  120   function g etGMVRecor d(aParam:  string): T StringList ;
  121   function s etGMVError Record(aPa ram: strin g): TStrin gList;
  122  
  123   function g etPatientI NQInfo(aIN Q, aDFN: s tring): TS tringList;  // ?????
  124   function g etPatientA llergies(a DFN: strin g): TStrin gList;
  125  
  126   //// Manag er /////// ////////// ////////// ////////// ////////// ////////// //////////
  127   //
  128   // Manager  calls are  not used  in the DLL
  129   // so we w ill includ e them in  this modul e later so me time...
  130   //
  131   function p rintQualif ierTable(a X, aY: str ing): stri ng;
  132   function g etGUIVersi onList: TS tringList;
  133   function s etSystemPa rameter(aN ame, aValu e, anOptio n: string) : string;
  134  
  135   function g etVitalHiL o(aVitalTy pe: string ): string;
  136   function s etVitalHiL o(aVitalTy pe, aValue : string):  string;
  137  
  138   function g etDeviceLi st(aTarget , aMargin:  string; D irection:  Integer =  1): string ;
  139  
  140   function g etLocation sByName(aT arget: str ing): stri ng;
  141   function g etLocation sByAppt(aD FN, aFrom,  aTo, aFla g: string) : string;
  142   function g etLocation sByAdmit(a DFN: strin g): string ;
  143   //function  getClinic sByName(aS tartFrom,a Count,aDir ection:Str ing):Strin g;
  144   function g etClinicFi leEntriesB yName(aSta rtFrom, aC ount, aDir ection: st ring): TSt ringList;  // vhaisha ndria 0608 10
  145  
  146   function g etClosestR eading(aDF N, aDate,  aType, aDi rection: s tring): St ring;
  147  
  148   var
  149     ServerDe lay: TDate Time;
  150     CheckBro kerFlag: B oolean;
  151  
  152   implementa tion
  153  
  154   uses
  155     Dialogs,
  156     uGMV_Com mon
  157     , uGMV_C onst
  158     , fGMV_R PCLog
  159     , uGMV_F ileEntry,  uGMV_Versi onInfo, uG MV_RPC_Nam es, uGMV_L og
  160     ;
  161  
  162   ////////// ////////// ////////// ////////// ////////// ////////// ////////// //////////
  163  
  164   function C allRPC(Rem oteProcedu re: string ;
  165     Paramete rs: array  of string;  MultList:  TStringLi st = nil;
  166     RPCMode:  TRPCMode  = []; RetL ist: TStri ngs = nil) : Boolean;
  167   var
  168     anItem:  TRPCEventI tem;
  169     aStart,  aStop: TDa teTime;
  170     aList: T Strings;
  171     iLimit:  Integer;
  172     i: integ er;
  173     SL: TStr ingList;
  174   begin
  175     aStart : = Now;
  176     Result : =
  177       CallRe moteProc(R PCBroker,  RemoteProc edure, Par ameters, M ultList, R PCMode, Re tList);
  178     aStop :=  Now;
  179  
  180     if RetLi st = nil t hen aList  := RPCBrok er.Results
  181     else aLi st := RetL ist;
  182  
  183     anItem : = getRPCEv entItem(aS tart, aSto p,
  184       Remote Procedure,
  185       Parame ters,
  186       MultLi st,
  187       RPCMod e,
  188       aList
  189       );
  190  
  191     SL := TS tringList. Create;
  192     for i :=  Low(param eters) to  High(Param eters) do
  193       SL.Add (Parameter s[i]);
  194  
  195     Inc(RPCC ount);
  196     RPCLog.I nsertObjec t(0,
  197       Format ('%10.10d  ', [RPCCou nt]) +
  198       Format DateTime(' hh:mm:ss.z zz', aStar t) + '   '  + RemoteP rocedure
  199       + ' ('  + SL.Comm aText + ') ' // vhais handria 06 0724
  200       ,
  201       anItem );
  202     SL.Free;
  203  
  204     iLimit : = 300;
  205     if assig ned(frmGMV _RPCLog) t hen
  206       iLimit  := StrToI ntDef(frmG MV_RPCLog. ComboBox1. Text, iLim it);
  207  
  208     while RP CLog.Count  > iLimit  do
  209     begin
  210       if RPC Log.Object s[RPCLog.C ount - 1]  <> nil the n
  211         TRPC EventItem( RPCLog.Obj ects[RPCLo g.Count -  1]).Free;
  212       RPCLog .Delete(RP CLog.Count  - 1);
  213     end;
  214  
  215     if assig ned(frmGMV _RPCLog) t hen
  216     begin
  217       frmGMV _RPCLog.lb Log.Items. Assign(RPC Log);
  218       frmGMV _RPCLog.lb Log.ItemIn dex := 0;
  219       frmGMV _RPCLog.lb LogClick(n il);
  220     end;
  221   end;
  222  
  223   ////////// ////////// ////////// ////////// ////////// ////////// ////////// //////////
  224  
  225   function g etRPCResul tStringLis t(aProcedu re: string ; ParamLST : array of  string;
  226     RPCMode:  TRPCMode  = []): TSt ringList;
  227   var
  228     SL: TStr ingList;
  229   begin
  230     SL := TS tringList. Create;
  231     CallRPC( aProcedure , ParamLST , nil, RPC Mode, SL);
  232     Result : = SL;
  233   end;
  234  
  235   function g etRPCResul tString(aP rocedure:  string; Pa ramLST: ar ray of str ing;
  236     RPCMode:  TRPCMode  = []): str ing;
  237   var
  238     SL: TStr ingList;
  239   begin
  240     try
  241       SL :=  getRPCResu ltStringLi st(aProced ure, Param LST, RPCMo de);
  242       Result  := SL.Tex t;
  243     except
  244       Result  := '-1^Er ror';
  245     end;
  246   end;
  247  
  248   ////////// ////////// ////////// ////////// ////////// ////////// ////////// //////////
  249   //  The ne xt RPC is  used to re trieve Pat ient infor mation.
  250   //  It is  used only  once in mo dule fGMV_ PtInfo (se e line 51) .
  251   //  By def ault aINQ  is equal t o RPC_PATI ENTINFO =  'ORWPT PTI NQ';
  252   //  the us er setting s could ov erwrite th e default  value.
  253   ////////// ////////// ////////// ////////// ////////// ////////// ////////// //////////
  254  
  255   function g etPatientI NQInfo(aIN Q, aDFN: s tring): TS tringList;
  256   var
  257     SL: TStr ingList;
  258   begin
  259     SL := TS tringList. Create;
  260     CallRPC( aINQ, [aDF N], nil, [ rpcSilent,  rpcNoResC hk], SL);
  261     Result : = SL;
  262   end;
  263  
  264   (*
  265   function g etProcedur eResultLis t(aProc,aP aram:Strin g):TString List;
  266   var
  267     SL: TStr ingList;
  268   begin
  269     SL := TS tringList. Create;
  270     CallRPC( aProc, [aP aram], nil ,[rpcNoRes Chk,rpcSil ent],SL);
  271     Result : = SL;
  272   end;
  273   *)
  274  
  275   function g etGMVRecor d(aParam:  string): T StringList ;
  276   var
  277     SL: TStr ingList;
  278   begin
  279     SL := TS tringList. Create;
  280     CallRPC( RPC_GMV_RE CORD, [aPa ram], nil,  [rpcNoRes Chk, rpcSi lent], SL) ;
  281     Result : = SL;
  282   end;
  283  
  284   function s etGMVError Record(aPa ram: strin g): TStrin gList;
  285   var
  286     SL: TStr ingList;
  287   begin
  288     SL := TS tringList. Create;
  289     CallRPC( RPC_GMV_MA RK_ERROR,  [aParam],  nil, [rpcN oResChk, r pcSilent],  SL);
  290     Result : = SL;
  291   end;
  292  
  293   //======== ========== ========== ========== ========== ========== ========== ==========
  294  
  295   function g etGUIVersi onList: TS tringList;
  296   var
  297     SL: TStr ingList;
  298   begin
  299     SL := TS tringList. Create;
  300     CallRPC( RPC_PARAME TER, ['GET LST', 'SYS ', 'GMV GU I VERSION' ], nil, [r pcSilent,  rpcNoResCh k], SL);
  301     Result : = SL;
  302   end;
  303  
  304   function g etEXEInfo( anEXEName:  string):  string;
  305   begin
  306     CallRPC( RPC_PARAME TER, ['GET PAR', 'SYS ', 'GMV GU I VERSION' , anExeNam e], nil);
  307     Result : = RPCBroke r.Results[ 0];
  308   end;
  309  
  310   function g etDLLInfo( anEXEName:  string):  string;
  311   begin
  312     CallRPC( RPC_DLL_VE RSION, [an ExeName],  nil);
  313     Result : = RPCBroke r.Results[ 0];
  314   end;
  315  
  316   function g etALLPatie ntData(aPa tient, aFr om, aTo: s tring): TS tringList;
  317   var
  318     i: Integ er;
  319     SL: TStr ingList;
  320   begin
  321     SL := TS tringList. Create;
  322  
  323     CallRPC( RPC_PATIEN T_VITALS_A LL, [aPati ent + '^'  + aFrom +  '^' + aTo  + '^0'], n il, []);
  324     if RPCBr oker.Resul ts.Count >  4 then
  325       for i  := RPCBrok er.Results .Count - 1  downto 4  do
  326         SL.A dd(RPCBrok er.Results [i]);
  327  
  328     Result : = SL;
  329   end;
  330  
  331   function g etCurrentD ateTime: s tring;
  332   begin
  333     // TEST  FOR PARAME TERS
  334     // Forma lly the ne xt RPC doe s not requ ire parame ters.
  335     // But w ithout par ameters it  generates  error in  some envir onments
  336   //  if Cal lRPC(RPC_C urrentTime , [], nil, [rpcSilent ,rpcNoResC hk]) then
  337     if CallR PC(RPC_Cur rentTime,  ['1'], nil , [rpcSile nt, rpcNoR esChk]) th en // dumm y paramete r
  338       Result  := RPCBro ker.Result s[0]
  339     else
  340       Result  := '';
  341   end;
  342  
  343   function c onvertMDat e(aValue:  string): s tring;
  344   begin
  345     if CallR PC(RPC_DAT E_CONVERT,  [aValue],  nil, [])  and
  346       (RPCBr oker.Resul ts.Count >  0) then
  347       Result  := Piece( RPCBroker. Results[0] , '^', 1)
  348     else
  349       Result  := '';
  350   end;
  351  
  352   function g etStationI nfo: strin g;
  353   var
  354     s: strin g;
  355   begin
  356     s := '';
  357     if CallR PC(RPC_PAT IENT_SELEC T, ['CCOW' ], nil, [] ) then
  358       s := R PCBroker.R esults[0];
  359     Result : = s;
  360   end;
  361  
  362   function g etPatientL ist(aTarge t: string) : TStringL ist;
  363   var
  364     SL: TStr ingList;
  365   begin
  366     SL := TS tringList. Create;
  367     CallRPC( RPC_PATIEN T_SELECT,  ['PTLKUP',  '', aTarg et], nil,  [rpcSilent , rpcNoRes Chk], SL);
  368     Result : = SL;
  369   end;
  370  
  371   function l ogPatientA ccess(aPat ient: stri ng): strin g;
  372   begin
  373     Result : = '';
  374   // 060929  vhaishandr ia LOGSECU RITY or LO GSEC ?
  375   //  CallRP C(RPC_PATI ENT_SELECT , ['LOGSEC ', aPatien t, 'RPCCAL L^Clinical  Procedure  GUI v1'],
  376     CallRPC( RPC_PATIEN T_SELECT,
  377       ['LOGS EC', aPati ent, RPC_C REATECONTE XT + '^' +  CurrentEx eNameAndVe rsion],
  378       nil, [ rpcSilent,  rpcNoResC hk]);
  379   // 2008-03 -10 vhaish andria LOG SECURITY w as used be fore fix
  380   //  CallRP C(RPC_PATI ENT_SELECT , ['LOGSEC URITY', aP atient, 'R PCCALL^Cli nical Proc edure GUI  v1'],
  381   //    nil,  [rpcSilen t, rpcNoRe sChk]);
  382     Result : = RPCBroke r.Results[ 0]
  383   end;
  384  
  385   function g etPatientI nfo(aPatie nt: string ): TString List;
  386   var
  387     SL: TStr ingList;
  388   begin
  389     SL := TS tringList. Create;
  390     CallRPC( RPC_PATIEN T_SELECT,  ['SELECT',  aPatient] , nil, [rp cSilent, r pcNoresChk ], SL);
  391     Result : = SL;
  392   end;
  393  
  394   function g etPatientH eader(aPat ient: stri ng): TStri ngList;
  395   var
  396     SL: TStr ingList;
  397   begin
  398     SL := TS tringList. Create;
  399     CallRPC( RPC_PATIEN T_SELECT,  ['PTHDR',  aPatient],  nil, [rpc Silent, rp cNoresChk] , SL);
  400     Result : = SL;
  401   end;
  402  
  403   function g etServerWD ateTime: T DateTime;
  404   begin
  405     try
  406       Result  := FMDate TimeToWind owsDateTim e(StrToFlo at(getCurr entDateTim e));
  407     except
  408       on E:  Exception  do
  409         Resu lt := 0;
  410     end;
  411   end;
  412  
  413   function g etServerWD ateTimeStr ing: strin g;
  414   begin
  415     try
  416       Result  := Format DateTime(G MV_DateTim eFormat, F MDateTimeT oWindowsDa teTime(Str ToFloat(ge tCurrentDa teTime)));
  417     except
  418       on E:  Exception  do
  419         Resu lt := '';
  420     end;
  421   end;
  422  
  423   function g etServerWD elay: TDat eTime;
  424   begin
  425     Result : = getServe rWDateTime  - Now;
  426   end;
  427   ////////// ////////// ////////// ////////// ////////// ////////// ////////// //////////
  428   // System  Parameters
  429   ////////// ////////// ////////// ////////// ////////// ////////// ////////// //////////
  430  
  431   function g etSystemPa rameterByN ame(aName:  string):  string; //  fGMV_Mana ger
  432   begin
  433     if CallR PC(RPC_PAR AMETER, [' GETPAR', ' SYS', aNam e], nil, [ rpcSilent,  rpcNoResC hk]) then
  434       Result  := RPCBro ker.Result s[0]
  435     else
  436       Result  := '';
  437   end;
  438  
  439   function g etWebLinkA ddress: st ring;
  440   begin
  441     Result : = getSyste mParameter ByName('GM V WEBLINK' );
  442   end;
  443  
  444   function s etSystemPa rameter(aN ame, aValu e, anOptio n: string) : string;
  445   begin
  446     CallRPC( RPC_PARAME TER, ['SET PAR', 'SYS ', aName,  aValue, an Option], n il, []);
  447     Result : = RPCBroke r.Results[ 0];
  448   end;
  449  
  450   function g etUserPara meter: str ing; // uG MV_User
  451   begin
  452     if CallR PC(RPC_PAR AMETER, [' GETPAR', ' SYS', 'GMV  ALLOW USE R TEMPLATE S'], nil,  [], nil) t hen
  453       Result  := RPCBro ker.Result s[0]
  454     else
  455       Result  := '';
  456   end;
  457  
  458   function g etUserSign OnInfo: TS tringList;
  459   var
  460     SL: TStr ingList;
  461   begin
  462     SL := TS tringList. Create;
  463     CallRPC( RPC_USER,  ['SIGNON',  ''], nil,  [rpcSilen t, rpcNoRe sChk], SL) ;
  464     Result : = SL;
  465   end;
  466  
  467   function g etUserDUZS tring: str ing;
  468   var
  469     SL: TStr ingList;
  470   begin
  471     SL := ge tUserSignO nInfo;
  472     if SL.Co unt > 0 th en
  473       Result  := SL[0]
  474     else
  475       Result  := '';
  476     SL.Free;
  477   end;
  478  
  479   function g etUserSett ings(aName : string):  string;
  480   begin
  481   (*
  482  
  483     ..  ABNO RMALBGCOLO R             15
  484       ABNORM ALBOLD                 OFF
  485       ABNORM ALQUALIFIE RS          OFF
  486       ABNORM ALTEXTCOLO R           9
  487       CLINIC _INDEX                 -1
  488       CPRSMe tricStyle              VitalsMet ricStyle
  489       CloseI nputWindow AfterSave   DoNotClos eInputWind ow
  490       Conver sionWarnin gStatus     ON
  491       Defaul tTemplate              114;DIC(4 .2,|WARD
  492       GRAPH  OPTIONS VI SIBLE       1
  493       GRAPHC OLOR                   -21474836 43
  494       GRAPHO PTIONS                 ON
  495       GRAPHO PTIONS-1               OFF
  496       GRAPHO PTIONS-2               OFF
  497       GRAPHO PTIONS-3               ON
  498       GRAPHO PTIONS-4               ON
  499       GRAPH_ INDEX                  8
  500       GRIDSI ZE                     314
  501       GridDa teRange                15
  502       LastVi talsListHe ight        144
  503       NORMAL BGCOLOR                15
  504       NORMAL BOLD                   OFF
  505       NORMAL QUALIFIERS             OFF
  506       NORMAL TEXTCOLOR              0
  507       OneUna vailableBo x           ManyUnava ilableBoxe s
  508       ParamT reeWidth               165
  509       Refuse Status                 ON
  510       SELECT OR_TAB                 4
  511       Search Delay                  1.0
  512       ShowLa stVitals               NoLatestV itals
  513       ShowTe mplates                NoTemplat es
  514       TEAM_I NDEX                   -1
  515       TfrmGM V_InputLit e           1024;768; 360;0;640; 480;0
  516       UNIT_I NDEX                   -1
  517       Unavai lableStatu s           ON
  518       VIEW-H EIGHT                  519
  519       VIEW-L EFT                    363
  520       VIEW-T OP                     7
  521       VIEW-W IDTH                   640
  522       Vitals Lite                   1024;768; 361;34;640 ;480;0
  523       WARD_I NDEX                   -1
  524   *)
  525  
  526     try
  527       if Cal lRPC(RPC_U SER, ['GET PAR', aNam e], nil, [ rpcSilent,  rpcNoResC hk]) then
  528         Resu lt := RPCB roker.Resu lts[0]
  529       else
  530         Resu lt := '';
  531     except
  532       on E:  Exception  do
  533         Resu lt := '';
  534     end;
  535   end;
  536  
  537   function s etUserSett ings(aName , aValue:  string): s tring;
  538   begin
  539     if CallR PC(RPC_USE R, ['SETPA R', aName  + '^' + aV alue], nil , [rpcSile nt, rpcNoR esChk]) th en
  540       Result  := RPCBro ker.Result s[0]
  541     else
  542       Result  := '-1^Un known Erro r';
  543   end;
  544  
  545   function g etVitalQua lifierList (aVital: s tring): TS tringList;
  546   var
  547     SL: TStr ingList;
  548   begin
  549     // ?
  550     SL := TS tringList. Create;
  551     CallRPC( RPC_VITALS _QUALIFIER S, [aVital ], nil, [r pcSilent,  rpcNoResCh k], SL);
  552     Result : = SL
  553   end;
  554  
  555   function g etQualifie rs(aVital,  aCategory : string):  TStringLi st;
  556   var
  557     SL: TStr ingList;
  558   begin
  559     SL := TS tringList. Create;
  560     CallRPC( RPC_MANAGE R, ['GETQU AL', aVita l + ';' +  aCategory] , nil, [],  SL);
  561     Result : = SL;
  562   end;
  563  
  564   function g etCategory Qualifiers (aVital: s tring): TS tringList;
  565   var
  566     SL: TStr ingList;
  567   begin
  568     SL := TS tringList. Create;
  569     CallRPC( RPC_MANAGE R, ['GETCA TS', aVita l], nil, [ rpcSilent,  rpcNoResC hk], SL);
  570     Result : = SL;
  571   end;
  572  
  573   function g etFileEntr ies(aFile:  string):  TStringLis t;
  574   var
  575     SL: TStr ingList;
  576   begin
  577     SL := TS tringList. Create;
  578     CallRPC( RPC_MANAGE R, ['GETLI ST', aFile ], nil, [] , SL);
  579     Result : = SL;
  580   end;
  581  
  582   function g etFileFiel d(aFile, a Field, anI EN: string ): string;
  583   begin
  584     if CallR PC(RPC_MAN AGER, ['GE TDATA', aF ile + '^'  + anIEN +  '^' + aFie ld], nil,  [rpcSilent , rpcNoRes Chk], nil)  then
  585       Result  := RPCBro ker.Result s[0]
  586     else
  587       Result  := '';
  588   end;
  589  
  590   function g etLookupEn tries(aFil e, aTarget : string):  TStringLi st;
  591   var
  592     SL: TStr ingList;
  593   begin
  594     SL := TS tringList. Create;
  595     CallRPC( RPC_MANAGE R, ['LOOKU P', aFile  + '^' + aT arget], ni l, [rpcSil ent, rpcNo ResChk], S L);
  596     Result : = SL;
  597   end;
  598  
  599   function g etVitalsID List: TStr ingList;
  600   var
  601     SL: TStr ingList;
  602   begin
  603     SL := TS tringList. Create;
  604     CallRPC( RPC_MANAGE R, ['VT',  ''], nil,  [rpcNoResC hk], SL);
  605     Result : = SL;
  606   end;
  607  
  608  
  609   function g etVitalTyp eIEN(aVita l: string) : string;
  610   begin
  611    // ?
  612     if CallR PC(RPC_VIT AL_TYPE_IE N, [aVital ], nil, [r pcSilent,  rpcNoResCh k], nil) t hen
  613       Result  := RPCBro ker.Result s[0]
  614     else
  615       Result  := '';
  616   end;
  617  
  618   function g etVitalCat egoryIEN(a Category:  string): s tring;
  619   begin
  620     if CallR PC(RPC_VIT AL_CATEGOR Y_IEN, [aC ategory],  nil, [], n il) then
  621       Result  := RPCBro ker.Result s[0]
  622     else
  623       Result  := '';
  624   end;
  625  
  626  
  627   function g etTemplate List: TStr ingList;
  628   var
  629     SL: TStr ingList;
  630   begin
  631     SL := TS tringList. Create;
  632     CallRPC( RPC_MANAGE R, ['GETTE MP'], nil,  [rpcSilen t, rpcNore sChk], SL) ;
  633     Result : = SL;
  634   end;
  635  
  636   function a ddVM(aValu e: string) : string;
  637   begin
  638     if CallR PC(RPC_VIT AL_ADD_VAL UE, [aValu e], nil, [ rpcSilent,  rpcNoresC hk]) then
  639       Result  := ''
  640     else
  641       Result  := RPCBro ker.Result s.Text;
  642   end;
  643  
  644   function g etNursingU nitPatient s(aUnit: s tring): TS tringList;
  645   var
  646     SL: TStr ingList;
  647   begin
  648     SL := TS tringList. Create;
  649     CallRPC( RPC_NUR_UN IT_PATIENT S, [aUnit] , nil, [rp cNoResChk,  rpcSilent ], SL);
  650     Result : = SL;
  651   end;
  652  
  653   function g etWardPati ents(aWard : string):  TStringLi st;
  654   var
  655     SL: TStr ingList;
  656   begin
  657     SL := TS tringList. Create;
  658     CallRPC( RPC_WARD_P ATIENTS, [ aWard], ni l, [rpcNoR esChk, rpc Silent], S L);
  659     Result : = SL;
  660   end;
  661  
  662   function g etTeamPati ents(aTeam : string):  TStringLi st;
  663   var
  664     SL: TStr ingList;
  665   begin
  666     SL := TS tringList. Create;
  667     CallRPC( RPC_TEAM_P ATIENTS, [ aTeam], ni l, [rpcNoR esChk, rpc Silent], S L);
  668     Result : = SL;
  669   end;
  670  
  671   function g etClinicPa tients(aCl inic, aDat e: string) : TStringL ist;
  672   var
  673     SL: TStr ingList;
  674   begin
  675     SL := TS tringList. Create;
  676     CallRPC( RPC_CLINIC _PATIENTS,  [aClinic,  aDate], n il, [rpcNo ResChk, rp cSilent],  SL);
  677     Result : = SL;
  678   end;
  679  
  680   //======== ========== ========== ========== ========== ========== ========== ==========
  681  
  682   function n ewTemplate (aCategory , aName, a Value: str ing): stri ng;
  683   begin
  684     CallRPC( RPC_MANAGE R, ['NEWTE MP', aCate gory + '^'  + aName +  '^' + aVa lue], nil,  []);
  685     Result : = RPCBroke r.Results[ 0]
  686   end;
  687  
  688   procedure  setTemplat e(anID, aN ame, aValu e: string) ;
  689   begin
  690     CallRPC( RPC_MANAGE R, ['SETTE MP', anID  + '^' + aN ame + '^'  + aValue],  nil, []);
  691   end;
  692  
  693   function r enameTempl ate(anID,  aName, aNe wName: str ing): stri ng;
  694   begin
  695     CallRPC( RPC_MANAGE R, ['RENTE MP', anID  + '^' + aN ame + '^'  + aNewname ], nil, [r pcNoResChk , rpcSilen t]); //vha ishandria  051229
  696     Result : = RPCBroke r.Results[ 0];
  697   end;
  698  
  699   function g etTemplate Value(anID , aName: s tring): st ring;
  700   begin
  701     try
  702       if Cal lRPC(RPC_M ANAGER, [' GETTEMP',  anID + '^'  + aName],  nil, [])  then
  703         Resu lt := RPCB roker.Resu lts[1]
  704       else
  705         Resu lt := '';
  706     except
  707       Result  := '';
  708     end;
  709   end;
  710  
  711   function s etDefaultT emplate(an ID, aName:  string):  string;
  712   begin
  713     if CallR PC(RPC_MAN AGER, ['SE TDEF', anI D + '^' +  aName], ni l, []) the n
  714       Result  := RPCBro ker.Result s[0]
  715     else
  716       Result  := '-1';
  717   end;
  718  
  719   function g etDefaultT emplateByI D(anID: st ring): str ing;
  720   begin
  721     try
  722       if Cal lRPC(RPC_M ANAGER, [' GETDEF', a nID], nil,  []) then
  723         Resu lt := RPCB roker.Resu lts[0]
  724       else
  725         Resu lt := '-1' ;
  726     except
  727       Result  := '-1';
  728     end;
  729   end;
  730  
  731   function g etDefaultT emplateLis t: TString List;
  732   var
  733     SL: TStr ingList;
  734   begin
  735     SL := TS tringList. Create;
  736     CallRPC( RPC_MANAGE R, ['GETDE F'], nil,  [rpcNoResC hk, rpcSil ent], SL);
  737     Result : = SL;
  738   end;
  739  
  740   function g etTemplate ListByID(a nID: strin g): TStrin gList;
  741   var
  742     SL: TStr ingList;
  743   begin
  744     SL := TS tringList. Create;
  745     if anID  <> '' then
  746       CallRP C(RPC_MANA GER, ['GET TEMP', anI D], nil, [ ], SL)
  747     else
  748       CallRP C(RPC_MANA GER, ['GET TEMP'], ni l, [], SL) ;
  749     Result : = SL;
  750   end;
  751  
  752   function c reateUserT emplateByN ame(aName:  string):  string;
  753   begin
  754     try
  755       if Cal lRPC(RPC_M ANAGER, [' NEWTEMP',  'USR^' + a Name + '^N o Descript ion'], nil , [rpcNoRe sChk]) the n
  756         Resu lt := RPCB roker.Resu lts[0]
  757       else
  758         Resu lt := '-1' ;
  759     except
  760       Result  := '-1';
  761     end;
  762   end;
  763  
  764   function d eleteTempl ate(aCateg ory, aName : string):  string;
  765   begin
  766     try
  767       if Cal lRPC(RPC_M ANAGER, [' DELTEMP',  aCategory  + '^' + aN ame], nil,  []) then
  768         Resu lt := RPCB roker.Resu lts[0]
  769       else
  770         Resu lt := '-1^ Unknown Er ror';
  771     except
  772       Result  := '-1^Un known Erro r';
  773     end;
  774   end;
  775  
  776   function d eleteUserT emplate(aN ame: strin g): string ;
  777   begin
  778     Result : = deleteTe mplate('US R', aName) ;
  779   end;
  780  
  781   ////////// ////////// ////////// ////////// ////////// ////////// ////////// //////////
  782  
  783   function c reateConte xt(aContex t: string) : Boolean;
  784   begin
  785     Result : = RPCBroke r.CreateCo ntext(aCon text);
  786   end;
  787  
  788   function E ngineReady : Boolean;
  789   begin
  790     Result : = Assigned (RPCBroker );
  791   end;
  792  
  793   function g etLatestVi talsByDFN( aDFN: stri ng; aSilen t: Boolean ): TString List;
  794   var
  795     SL: TStr ingList;
  796   begin
  797     SL := TS tringList. Create;
  798     try
  799       if aSi lent then
  800         Call RPC(RPC_PA TIENT_LATE ST_VITALS,  [aDFN], n il, [rpcNo ResChk, rp cSilent],  SL)
  801       else
  802         Call RPC(RPC_PA TIENT_LATE ST_VITALS,  [aDFN], n il, [], SL );
  803     except
  804     end;
  805     Result : = SL;
  806   end;
  807  
  808   function g etHospital LocationBy ID(anID: s tring): st ring;
  809   begin
  810   // vhaisha ndria 2007 -07-17 --- ---------- ---------- ---------- ---------- ---- Begin
  811     Result : = '';
  812     if trim( anID) = ''  then
  813       Exit;
  814   // vhaisha ndria 2007 -07-17 --- ---------- ---------- ---------- ---------- ----   End
  815     try
  816       if Cal lRPC(RPC_P ATIENT_SEL ECT, ['HOS PLOC', anI D], nil, [ rpcNoResCh k, rpcSile nt]) then
  817         Resu lt := RPCB roker.Resu lts[0]
  818       else
  819         Resu lt := '';
  820     except
  821       Result  := '';
  822     end;
  823   end;
  824  
  825   function g etWardLoca tions(anOp tion: stri ng = ''):  TStringLis t;
  826   var
  827     SL: TStr ingList;
  828   begin
  829     SL := TS tringList. Create;
  830     CallRPC( RPC_WARD_L OCATION, [ anOption],  nil, [],  SL);
  831     Result : = SL;
  832   end;
  833  
  834   function g etRoomBedB yWard(aWar d: string) : TStringL ist;
  835   var
  836     SL: TStr ingList;
  837   begin
  838     SL := TS tringList. Create;
  839     CallRPC( RPC_ROOM_B ED, [aWard ], nil, [] , SL);
  840     Result : = SL;
  841   end;
  842  
  843   function g etProcedur eResult(aP roc, aPara m: string) : string;
  844   begin
  845     try
  846       if Cal lRPC(aProc , [aParam] , nil, [rp cNoResChk,  rpcSilent ]) then
  847         Resu lt := RPCB roker.Resu lts[0]
  848       else
  849         Resu lt := 'Pro cedure ' +  aProc + ' (' + aPara m + ') Fai led';
  850     except
  851       Result  := 'Proce dure ' + a Proc + '('  + aParam  + ') Faile d';
  852     end;
  853   end;
  854  
  855   function g etPatientA llergies(a DFN: strin g): TStrin gList;
  856   var
  857     SL: TStr ingList;
  858   begin
  859     SL := TS tringList. Create;
  860     CallRPC( RPC_PATIEN T_ALLERGIE S, [aDFN],  nil, [],  SL);
  861     Result : = SL;
  862   end;
  863  
  864   ////////// ////////// ////////// ////////// ////////// ////////// ////////// //////////
  865  
  866   function p rintQualif ierTable(a X, aY: str ing): stri ng;
  867   begin
  868     CallRPC( RPC_QUALIF IER_TABLE,  ['^^^^' +  aX + '^^'  + aY], ni l);
  869     Result : = RPCBroke r.Results[ 0]
  870   end;
  871  
  872  
  873   function a ddQualifie r(aVitalID , aCategor yID, aQual ifierID: s tring): st ring;
  874   begin
  875     CallRPC( RPC_MANAGE R, ['ADDQU AL', aVita lID + ';'  + aCategor yID + ';'  + aQualifi erID], nil );
  876     Result : = RPCBroke r.Results[ 0]
  877   end;
  878  
  879   function d elQualifie r(aVitalID , aCategor yID, aQual ifierID: s tring): st ring;
  880   begin
  881     CallRPC( RPC_MANAGE R, ['DELQU AL', aVita lID + ';'  + aCategor yID + ';'  + aQualifi erID], nil );
  882     Result : = RPCBroke r.Results[ 0]
  883   end;
  884  
  885   function A ddNewQuali fier(aName : string):  string;
  886   begin
  887     CallRPC( RPC_MANAGE R, ['NEWQU AL', aName ], nil);
  888     Result : = RPCBroke r.Results[ 0]
  889   end;
  890  
  891   function v alidateQua lifierName (aFDD, aIE N, aField,  aName: st ring): str ing;
  892   begin
  893     CallRPC( RPC_MANAGE R, ['VALID ', aFDD +  '^' + aIEN  + '^' + a Field + '^ ' + aName] , nil, []) ;
  894     Result : = RPCBroke r.Results[ 0];
  895   end;
  896  
  897   function s etQualifie rName(aFDD , aIEN, aF ield, aNam e: string) : string;
  898   begin
  899     CallRPC( RPC_MANAGE R, ['SETDA TA', aFDD  + '^' + aI EN + '^' +  aField +  '^' + aNam e], nil, [ ]);
  900     Result : = RPCBroke r.Results[ 0];
  901   end;
  902  
  903   function g etVitalHiL o(aVitalTy pe: string ): string;
  904   begin
  905     if aVita lType = '6 .2' then / / 6.2 - mi n CVP valu e could be  below 0
  906       CallRP C(RPC_MANA GER, ['GET HILO', aVi talType],  nil, [rpcS ilent])
  907     else
  908       CallRP C(RPC_MANA GER, ['GET HILO', aVi talType],  nil, []);
  909     Result : = RPCBroke r.Results[ 0];
  910   end;
  911  
  912   function s etVitalHiL o(aVitalTy pe, aValue : string):  string;
  913   begin
  914     CallRPC( RPC_MANAGE R, ['SETHI LO', aVita lType + '^ ' + aValue ], nil, [] );
  915     Result : = RPCBroke r.Results[ 0];
  916   end;
  917  
  918   function g etDeviceLi st(aTarget , aMargin:  string; D irection:  Integer =  1): string ;
  919   begin
  920     CallRPC( RPC_CHECK_ DEVICE, [a Target, In tToStr(Dir ection), a Margin], n il, [rpcNo ResChk, rp cSilent]);
  921     Result : = RPCBroke r.Results. Text;
  922   end;
  923  
  924   function g etLocation sByName(aT arget: str ing): stri ng;
  925   var
  926     SL: TStr ingList;
  927   begin
  928     SL := TS tringList. Create;
  929     CallRPC( RPC_LOCATI ON_SELECT,  ['NAME',  aTarget],  nil, [rpcN oResChk, r pcSilent],  SL);
  930     Result : = SL.Text;
  931     SL.Free;
  932   end;
  933  
  934   function g etLocation sByAppt(aD FN, aFrom,  aTo, aFla g: string) : string;
  935   begin
  936   // vhaisha ndria 2007 -07-16 --- ---------- ---------- ---------- ---------- ---- Begin
  937     Result : = '';
  938     if trim( aDFN) = ''  then
  939       Exit;
  940   // vhaisha ndria 2007 -07-16 --- ---------- ---------- ---------- ---------- ----   End
  941     CallRPC( RPC_LOCATI ON_SELECT,  ['APPT',  aDFN + '^'  + aFrom +  '^' + aTo  + '^' + a Flag], nil , [rpcNoRe sChk, rpcS ilent]);
  942     Result : = RPCBroke r.Results. Text;
  943   end;
  944  
  945   function g etLocation sByAdmit(a DFN: strin g): string ;
  946   begin
  947     Result : = '';
  948     if trim( aDFN) = ''  then
  949       Exit;
  950     CallRPC( RPC_LOCATI ON_SELECT,  ['ADMIT',  aDFN], ni l, [rpcNoR esChk, rpc Silent]);
  951     Result : = RPCBroke r.Results. Text;
  952   end;
  953  
  954   function g etClinicsB yName(aSta rtFrom, aC ount, aDir ection: st ring): str ing;
  955   begin
  956     CallRPC( RPC_LOCATI ON_SELECT,  ['CLINIC' , aStartFr om + '^' +  aCount +  '^' + aDir ection], n il, [rpcNo ResChk, rp cSilent]);
  957     Result : = RPCBroke r.Results. Text;
  958   end;
  959  
  960   function g etClinicFi leEntriesB yName(aSta rtFrom, aC ount, aDir ection: st ring): TSt ringList;
  961   var
  962     SL: TStr ingList;
  963     i: Integ er;
  964     fe: TGMV _FileEntry ;
  965   begin
  966     CallRPC( RPC_LOCATI ON_SELECT,  ['CLINIC' , aStartFr om + '^' +  aCount +  '^' + aDir ection], n il, [rpcNo ResChk, rp cSilent]);
  967     if copy( RPCBroker. Results.Te xt, 1, 1)  = '-' then
  968     begin
  969       Result  := nil;
  970       Exit;
  971     end;
  972     SL := TS tringList. Create;
  973     for i :=  1 to RPCB roker.Resu lts.Count  - 1 do
  974     begin
  975       fe :=  TGMV_FileE ntry.Creat eFromRPC(R PCBroker.R esults[i]) ;
  976   //    SL.A ddObject(f e.CaptionC onverted,  fe); // vh aishandria  2008-04-1 7
  977       SL.Add Object(fe. Caption, f e);
  978     end;
  979  
  980     Result : = SL;
  981   end;
  982  
  983   function g etClosestR eading(aDF N, aDate,  aType, aDi rection: s tring): St ring;
  984   begin
  985     Result : = '';
  986     if trim( aDFN) = ''  then
  987       Exit;
  988     CallRPC( RPC_CLOSES T_READING,  [aDFN, aD ate,aType, aDirection ], nil, [r pcNoResChk , rpcSilen t]);
  989     Result : = RPCBroke r.Results. Text;
  990   end;
  991  
  992   initializa tion
  993     CheckBro kerFlag :=  False;
  994   end.
  995