package shub.dpm;

import anywheresoftware.b4a.BA;
import anywheresoftware.b4a.pc.*;

public class appmain_subs_0 {


public static RemoteObject  _activity_create(RemoteObject _firsttime) throws Exception{
try {
		Debug.PushSubsStack("Activity_Create (appmain) ","appmain",6,appmain.mostCurrent.activityBA,appmain.mostCurrent,37);
if (RapidSub.canDelegate("activity_create")) { return shub.dpm.appmain.remoteMe.runUserSub(false, "appmain","activity_create", _firsttime);}
Debug.locals.put("FirstTime", _firsttime);
 BA.debugLineNum = 37;BA.debugLine="Sub Activity_Create(FirstTime As Boolean)";
Debug.ShouldStop(16);
 BA.debugLineNum = 39;BA.debugLine="Activity.AddMenuItem(\"Parameter\",\"bt1\")";
Debug.ShouldStop(64);
appmain.mostCurrent._activity.runVoidMethod ("AddMenuItem",(Object)(BA.ObjectToCharSequence("Parameter")),(Object)(RemoteObject.createImmutable("bt1")));
 BA.debugLineNum = 40;BA.debugLine="Activity.AddMenuItem(\"Über...\",\"bt2\")";
Debug.ShouldStop(128);
appmain.mostCurrent._activity.runVoidMethod ("AddMenuItem",(Object)(BA.ObjectToCharSequence("Über...")),(Object)(RemoteObject.createImmutable("bt2")));
 BA.debugLineNum = 42;BA.debugLine="Activity.LoadLayout(\"main\")";
Debug.ShouldStop(512);
appmain.mostCurrent._activity.runMethodAndSync(false,"LoadLayout",(Object)(RemoteObject.createImmutable("main")),appmain.mostCurrent.activityBA);
 BA.debugLineNum = 43;BA.debugLine="Activity.Title=\"DPM - Charge Scanner\"";
Debug.ShouldStop(1024);
appmain.mostCurrent._activity.runMethod(false,"setTitle",BA.ObjectToCharSequence("DPM - Charge Scanner"));
 BA.debugLineNum = 44;BA.debugLine="bs1.ScanMode = bs1.FORMAT_ONE_D";
Debug.ShouldStop(2048);
appmain.mostCurrent._bs1.runVoidMethod ("setScanMode",appmain.mostCurrent._bs1.getField(true,"FORMAT_ONE_D"));
 BA.debugLineNum = 45;BA.debugLine="PatID=0";
Debug.ShouldStop(4096);
appmain._patid = BA.NumberToString(0);
 BA.debugLineNum = 46;BA.debugLine="If File.Exists(File.DirInternal ,\"DPM.ini\") = Tru";
Debug.ShouldStop(8192);
if (RemoteObject.solveBoolean("=",appmain.mostCurrent.__c.getField(false,"File").runMethod(true,"Exists",(Object)(appmain.mostCurrent.__c.getField(false,"File").runMethod(true,"getDirInternal")),(Object)(RemoteObject.createImmutable("DPM.ini"))),appmain.mostCurrent.__c.getField(true,"True"))) { 
 BA.debugLineNum = 47;BA.debugLine="Get_Params";
Debug.ShouldStop(16384);
_get_params();
 }else {
 };
 BA.debugLineNum = 51;BA.debugLine="PatTimer.Initialize(\"timer\",timeout)";
Debug.ShouldStop(262144);
appmain.mostCurrent._pattimer.runVoidMethod ("Initialize",appmain.processBA,(Object)(BA.ObjectToString("timer")),(Object)(appmain._timeout));
 BA.debugLineNum = 52;BA.debugLine="If TempData.pid<>\"\" Then";
Debug.ShouldStop(524288);
if (RemoteObject.solveBoolean("!",appmain.mostCurrent._tempdata._pid /*RemoteObject*/ ,BA.ObjectToString(""))) { 
 BA.debugLineNum = 53;BA.debugLine="get_Pat(TempData.pid)";
Debug.ShouldStop(1048576);
_get_pat(appmain.mostCurrent._tempdata._pid /*RemoteObject*/ );
 BA.debugLineNum = 54;BA.debugLine="TempData.pid=\"\"";
Debug.ShouldStop(2097152);
appmain.mostCurrent._tempdata._pid /*RemoteObject*/  = BA.ObjectToString("");
 };
 BA.debugLineNum = 56;BA.debugLine="End Sub";
Debug.ShouldStop(8388608);
return RemoteObject.createImmutable("");
}
catch (Exception e) {
			throw Debug.ErrorCaught(e);
		} 
finally {
			Debug.PopSubsStack();
		}}
public static RemoteObject  _activity_pause(RemoteObject _userclosed) throws Exception{
try {
		Debug.PushSubsStack("Activity_Pause (appmain) ","appmain",6,appmain.mostCurrent.activityBA,appmain.mostCurrent,68);
if (RapidSub.canDelegate("activity_pause")) { return shub.dpm.appmain.remoteMe.runUserSub(false, "appmain","activity_pause", _userclosed);}
Debug.locals.put("UserClosed", _userclosed);
 BA.debugLineNum = 68;BA.debugLine="Sub Activity_Pause (UserClosed As Boolean)";
Debug.ShouldStop(8);
 BA.debugLineNum = 70;BA.debugLine="Try";
Debug.ShouldStop(32);
try { BA.debugLineNum = 71;BA.debugLine="bs1.stopScanning";
Debug.ShouldStop(64);
appmain.mostCurrent._bs1.runVoidMethod ("stopScanning");
 Debug.CheckDeviceExceptions();
} 
       catch (Exception e4) {
			BA.rdebugUtils.runVoidMethod("setLastException",appmain.processBA, e4.toString()); };
 BA.debugLineNum = 74;BA.debugLine="PatID=0";
Debug.ShouldStop(512);
appmain._patid = BA.NumberToString(0);
 BA.debugLineNum = 75;BA.debugLine="End Sub";
Debug.ShouldStop(1024);
return RemoteObject.createImmutable("");
}
catch (Exception e) {
			throw Debug.ErrorCaught(e);
		} 
finally {
			Debug.PopSubsStack();
		}}
public static RemoteObject  _activity_resume() throws Exception{
try {
		Debug.PushSubsStack("Activity_Resume (appmain) ","appmain",6,appmain.mostCurrent.activityBA,appmain.mostCurrent,58);
if (RapidSub.canDelegate("activity_resume")) { return shub.dpm.appmain.remoteMe.runUserSub(false, "appmain","activity_resume");}
 BA.debugLineNum = 58;BA.debugLine="Sub Activity_Resume";
Debug.ShouldStop(33554432);
 BA.debugLineNum = 59;BA.debugLine="If TempData.pid<>\"\" Then PatID=TempData.pid";
Debug.ShouldStop(67108864);
if (RemoteObject.solveBoolean("!",appmain.mostCurrent._tempdata._pid /*RemoteObject*/ ,BA.ObjectToString(""))) { 
appmain._patid = appmain.mostCurrent._tempdata._pid /*RemoteObject*/ ;};
 BA.debugLineNum = 60;BA.debugLine="If File.Exists(File.DirInternal ,\"DPM.ini\") = Tru";
Debug.ShouldStop(134217728);
if (RemoteObject.solveBoolean("=",appmain.mostCurrent.__c.getField(false,"File").runMethod(true,"Exists",(Object)(appmain.mostCurrent.__c.getField(false,"File").runMethod(true,"getDirInternal")),(Object)(RemoteObject.createImmutable("DPM.ini"))),appmain.mostCurrent.__c.getField(true,"True"))) { 
 BA.debugLineNum = 61;BA.debugLine="Get_Params";
Debug.ShouldStop(268435456);
_get_params();
 BA.debugLineNum = 62;BA.debugLine="PatTimer.Enabled=False";
Debug.ShouldStop(536870912);
appmain.mostCurrent._pattimer.runMethod(true,"setEnabled",appmain.mostCurrent.__c.getField(true,"False"));
 BA.debugLineNum = 63;BA.debugLine="PatTimer.Initialize(\"timer\",timeout)";
Debug.ShouldStop(1073741824);
appmain.mostCurrent._pattimer.runVoidMethod ("Initialize",appmain.processBA,(Object)(BA.ObjectToString("timer")),(Object)(appmain._timeout));
 BA.debugLineNum = 64;BA.debugLine="PatTimer.Enabled=True";
Debug.ShouldStop(-2147483648);
appmain.mostCurrent._pattimer.runMethod(true,"setEnabled",appmain.mostCurrent.__c.getField(true,"True"));
 };
 BA.debugLineNum = 66;BA.debugLine="End Sub";
Debug.ShouldStop(2);
return RemoteObject.createImmutable("");
}
catch (Exception e) {
			throw Debug.ErrorCaught(e);
		} 
finally {
			Debug.PopSubsStack();
		}}
public static RemoteObject  _bs1_scan_value(RemoteObject _val,RemoteObject _rawbyte,RemoteObject _barcodetype) throws Exception{
try {
		Debug.PushSubsStack("bs1_scan_value (appmain) ","appmain",6,appmain.mostCurrent.activityBA,appmain.mostCurrent,122);
if (RapidSub.canDelegate("bs1_scan_value")) { return shub.dpm.appmain.remoteMe.runUserSub(false, "appmain","bs1_scan_value", _val, _rawbyte, _barcodetype);}
RemoteObject _job = RemoteObject.declareNull("shub.dpm.httpjob");
RemoteObject _b = RemoteObject.declareNull("anywheresoftware.b4a.audio.Beeper");
Debug.locals.put("val", _val);
Debug.locals.put("rawbyte", _rawbyte);
Debug.locals.put("barcodetype", _barcodetype);
 BA.debugLineNum = 122;BA.debugLine="Sub bs1_scan_value(val As String, rawbyte() As Byt";
Debug.ShouldStop(33554432);
 BA.debugLineNum = 127;BA.debugLine="If DateDiff(\"ss\",dtnow,DateTime.Now)<2 Then Retur";
Debug.ShouldStop(1073741824);
if (RemoteObject.solveBoolean("<",BA.numberCast(double.class, _datediff(BA.ObjectToString("ss"),BA.NumberToString(appmain._dtnow),BA.NumberToString(appmain.mostCurrent.__c.getField(false,"DateTime").runMethod(true,"getNow")))),BA.numberCast(double.class, 2))) { 
if (true) return RemoteObject.createImmutable("");};
 BA.debugLineNum = 128;BA.debugLine="Dim job As HttpJob";
Debug.ShouldStop(-2147483648);
_job = RemoteObject.createNew ("shub.dpm.httpjob");Debug.locals.put("job", _job);
 BA.debugLineNum = 129;BA.debugLine="JobName=\"PostCharche\"";
Debug.ShouldStop(1);
appmain.mostCurrent._jobname = BA.ObjectToString("PostCharche");
 BA.debugLineNum = 130;BA.debugLine="job.Initialize(JobName, Me)";
Debug.ShouldStop(2);
_job.runClassMethod (shub.dpm.httpjob.class, "_initialize" /*RemoteObject*/ ,appmain.processBA,(Object)(appmain.mostCurrent._jobname),(Object)(appmain.getObject()));
 BA.debugLineNum = 132;BA.debugLine="dtnow=DateTime.Now";
Debug.ShouldStop(8);
appmain._dtnow = appmain.mostCurrent.__c.getField(false,"DateTime").runMethod(true,"getNow");
 BA.debugLineNum = 133;BA.debugLine="job.PostString(sURL&\"/DPMService/api/PatCharge/\"&";
Debug.ShouldStop(16);
_job.runClassMethod (shub.dpm.httpjob.class, "_poststring" /*RemoteObject*/ ,(Object)(RemoteObject.concat(appmain._surl,RemoteObject.createImmutable("/DPMService/api/PatCharge/"),appmain._patid,RemoteObject.createImmutable("/"),_val)),(Object)(RemoteObject.createImmutable("")));
 BA.debugLineNum = 135;BA.debugLine="Dim b As Beeper";
Debug.ShouldStop(64);
_b = RemoteObject.createNew ("anywheresoftware.b4a.audio.Beeper");Debug.locals.put("b", _b);
 BA.debugLineNum = 136;BA.debugLine="b.Initialize(300, 500) '300 milliseconds, 500 hz";
Debug.ShouldStop(128);
_b.runVoidMethod ("Initialize",(Object)(BA.numberCast(int.class, 300)),(Object)(BA.numberCast(int.class, 500)));
 BA.debugLineNum = 138;BA.debugLine="PatTimer.Enabled=True";
Debug.ShouldStop(512);
appmain.mostCurrent._pattimer.runMethod(true,"setEnabled",appmain.mostCurrent.__c.getField(true,"True"));
 BA.debugLineNum = 140;BA.debugLine="End Sub";
Debug.ShouldStop(2048);
return RemoteObject.createImmutable("");
}
catch (Exception e) {
			throw Debug.ErrorCaught(e);
		} 
finally {
			Debug.PopSubsStack();
		}}
public static RemoteObject  _bt1_click() throws Exception{
try {
		Debug.PushSubsStack("bt1_Click (appmain) ","appmain",6,appmain.mostCurrent.activityBA,appmain.mostCurrent,228);
if (RapidSub.canDelegate("bt1_click")) { return shub.dpm.appmain.remoteMe.runUserSub(false, "appmain","bt1_click");}
 BA.debugLineNum = 228;BA.debugLine="Sub bt1_Click";
Debug.ShouldStop(8);
 BA.debugLineNum = 229;BA.debugLine="StartActivity(\"Param\")";
Debug.ShouldStop(16);
appmain.mostCurrent.__c.runVoidMethod ("StartActivity",appmain.processBA,(Object)((RemoteObject.createImmutable("Param"))));
 BA.debugLineNum = 230;BA.debugLine="End Sub";
Debug.ShouldStop(32);
return RemoteObject.createImmutable("");
}
catch (Exception e) {
			throw Debug.ErrorCaught(e);
		} 
finally {
			Debug.PopSubsStack();
		}}
public static RemoteObject  _bt2_click() throws Exception{
try {
		Debug.PushSubsStack("bt2_click (appmain) ","appmain",6,appmain.mostCurrent.activityBA,appmain.mostCurrent,231);
if (RapidSub.canDelegate("bt2_click")) { return shub.dpm.appmain.remoteMe.runUserSub(false, "appmain","bt2_click");}
 BA.debugLineNum = 231;BA.debugLine="Sub bt2_click";
Debug.ShouldStop(64);
 BA.debugLineNum = 232;BA.debugLine="StartActivity(\"About\")";
Debug.ShouldStop(128);
appmain.mostCurrent.__c.runVoidMethod ("StartActivity",appmain.processBA,(Object)((RemoteObject.createImmutable("About"))));
 BA.debugLineNum = 233;BA.debugLine="End Sub";
Debug.ShouldStop(256);
return RemoteObject.createImmutable("");
}
catch (Exception e) {
			throw Debug.ErrorCaught(e);
		} 
finally {
			Debug.PopSubsStack();
		}}
public static RemoteObject  _btnenterpatid_click() throws Exception{
try {
		Debug.PushSubsStack("btnEnterPatID_Click (appmain) ","appmain",6,appmain.mostCurrent.activityBA,appmain.mostCurrent,217);
if (RapidSub.canDelegate("btnenterpatid_click")) { return shub.dpm.appmain.remoteMe.runUserSub(false, "appmain","btnenterpatid_click");}
 BA.debugLineNum = 217;BA.debugLine="Private Sub btnEnterPatID_Click";
Debug.ShouldStop(16777216);
 BA.debugLineNum = 218;BA.debugLine="txtPatNr.ForceDoneButton=True";
Debug.ShouldStop(33554432);
appmain.mostCurrent._txtpatnr.runVoidMethod ("setForceDoneButton",appmain.mostCurrent.__c.getField(true,"True"));
 BA.debugLineNum = 219;BA.debugLine="pnlEnterPatID.Visible=True";
Debug.ShouldStop(67108864);
appmain.mostCurrent._pnlenterpatid.runMethod(true,"setVisible",appmain.mostCurrent.__c.getField(true,"True"));
 BA.debugLineNum = 220;BA.debugLine="txtPatNr.Text=\"\"";
Debug.ShouldStop(134217728);
appmain.mostCurrent._txtpatnr.runMethodAndSync(true,"setText",BA.ObjectToCharSequence(""));
 BA.debugLineNum = 221;BA.debugLine="txtPatNr.RequestFocus";
Debug.ShouldStop(268435456);
appmain.mostCurrent._txtpatnr.runVoidMethod ("RequestFocus");
 BA.debugLineNum = 222;BA.debugLine="End Sub";
Debug.ShouldStop(536870912);
return RemoteObject.createImmutable("");
}
catch (Exception e) {
			throw Debug.ErrorCaught(e);
		} 
finally {
			Debug.PopSubsStack();
		}}
public static RemoteObject  _btnlistdata_click() throws Exception{
try {
		Debug.PushSubsStack("btnListdata_Click (appmain) ","appmain",6,appmain.mostCurrent.activityBA,appmain.mostCurrent,235);
if (RapidSub.canDelegate("btnlistdata_click")) { return shub.dpm.appmain.remoteMe.runUserSub(false, "appmain","btnlistdata_click");}
 BA.debugLineNum = 235;BA.debugLine="Private Sub btnListdata_Click";
Debug.ShouldStop(1024);
 BA.debugLineNum = 239;BA.debugLine="ListData.PatID=PatID";
Debug.ShouldStop(16384);
appmain.mostCurrent._listdata._patid /*RemoteObject*/  = appmain._patid;
 BA.debugLineNum = 240;BA.debugLine="TempData.pid=PatID";
Debug.ShouldStop(32768);
appmain.mostCurrent._tempdata._pid /*RemoteObject*/  = appmain._patid;
 BA.debugLineNum = 241;BA.debugLine="TempData.pname=lblPatient.Text";
Debug.ShouldStop(65536);
appmain.mostCurrent._tempdata._pname /*RemoteObject*/  = appmain.mostCurrent._lblpatient.runMethod(true,"getText");
 BA.debugLineNum = 242;BA.debugLine="ListData.sURL=sURL";
Debug.ShouldStop(131072);
appmain.mostCurrent._listdata._surl /*RemoteObject*/  = appmain._surl;
 BA.debugLineNum = 245;BA.debugLine="StartActivity(\"ListData\")";
Debug.ShouldStop(1048576);
appmain.mostCurrent.__c.runVoidMethod ("StartActivity",appmain.processBA,(Object)((RemoteObject.createImmutable("ListData"))));
 BA.debugLineNum = 246;BA.debugLine="End Sub";
Debug.ShouldStop(2097152);
return RemoteObject.createImmutable("");
}
catch (Exception e) {
			throw Debug.ErrorCaught(e);
		} 
finally {
			Debug.PopSubsStack();
		}}
public static RemoteObject  _btnsearchpat_click() throws Exception{
try {
		Debug.PushSubsStack("btnSearchPat_Click (appmain) ","appmain",6,appmain.mostCurrent.activityBA,appmain.mostCurrent,209);
if (RapidSub.canDelegate("btnsearchpat_click")) { return shub.dpm.appmain.remoteMe.runUserSub(false, "appmain","btnsearchpat_click");}
 BA.debugLineNum = 209;BA.debugLine="Private Sub btnSearchPat_Click";
Debug.ShouldStop(65536);
 BA.debugLineNum = 210;BA.debugLine="PatTimer.Enabled=False";
Debug.ShouldStop(131072);
appmain.mostCurrent._pattimer.runMethod(true,"setEnabled",appmain.mostCurrent.__c.getField(true,"False"));
 BA.debugLineNum = 211;BA.debugLine="get_Pat(txtPatNr.Text)";
Debug.ShouldStop(262144);
_get_pat(appmain.mostCurrent._txtpatnr.runMethod(true,"getText"));
 BA.debugLineNum = 212;BA.debugLine="pnlEnterPatID.Visible=False";
Debug.ShouldStop(524288);
appmain.mostCurrent._pnlenterpatid.runMethod(true,"setVisible",appmain.mostCurrent.__c.getField(true,"False"));
 BA.debugLineNum = 213;BA.debugLine="btnSearchPat.RequestFocus";
Debug.ShouldStop(1048576);
appmain.mostCurrent._btnsearchpat.runVoidMethod ("RequestFocus");
 BA.debugLineNum = 214;BA.debugLine="PatTimer.Enabled=True";
Debug.ShouldStop(2097152);
appmain.mostCurrent._pattimer.runMethod(true,"setEnabled",appmain.mostCurrent.__c.getField(true,"True"));
 BA.debugLineNum = 215;BA.debugLine="End Sub";
Debug.ShouldStop(4194304);
return RemoteObject.createImmutable("");
}
catch (Exception e) {
			throw Debug.ErrorCaught(e);
		} 
finally {
			Debug.PopSubsStack();
		}}
public static RemoteObject  _button1_click() throws Exception{
try {
		Debug.PushSubsStack("Button1_Click (appmain) ","appmain",6,appmain.mostCurrent.activityBA,appmain.mostCurrent,142);
if (RapidSub.canDelegate("button1_click")) { return shub.dpm.appmain.remoteMe.runUserSub(false, "appmain","button1_click");}
 BA.debugLineNum = 142;BA.debugLine="Sub Button1_Click";
Debug.ShouldStop(8192);
 BA.debugLineNum = 143;BA.debugLine="If PatID=0 Then";
Debug.ShouldStop(16384);
if (RemoteObject.solveBoolean("=",appmain._patid,BA.NumberToString(0))) { 
 BA.debugLineNum = 144;BA.debugLine="ToastMessageShow(\"Bitte zuerst Patient wählen\",T";
Debug.ShouldStop(32768);
appmain.mostCurrent.__c.runVoidMethod ("ToastMessageShow",(Object)(BA.ObjectToCharSequence("Bitte zuerst Patient wählen")),(Object)(appmain.mostCurrent.__c.getField(true,"True")));
 };
 BA.debugLineNum = 146;BA.debugLine="bs1.startScanning";
Debug.ShouldStop(131072);
appmain.mostCurrent._bs1.runVoidMethod ("startScanning");
 BA.debugLineNum = 147;BA.debugLine="PatTimer.Enabled=False";
Debug.ShouldStop(262144);
appmain.mostCurrent._pattimer.runMethod(true,"setEnabled",appmain.mostCurrent.__c.getField(true,"False"));
 BA.debugLineNum = 148;BA.debugLine="End Sub";
Debug.ShouldStop(524288);
return RemoteObject.createImmutable("");
}
catch (Exception e) {
			throw Debug.ErrorCaught(e);
		} 
finally {
			Debug.PopSubsStack();
		}}
public static RemoteObject  _button2_click() throws Exception{
try {
		Debug.PushSubsStack("Button2_Click (appmain) ","appmain",6,appmain.mostCurrent.activityBA,appmain.mostCurrent,150);
if (RapidSub.canDelegate("button2_click")) { return shub.dpm.appmain.remoteMe.runUserSub(false, "appmain","button2_click");}
 BA.debugLineNum = 150;BA.debugLine="Private Sub Button2_Click";
Debug.ShouldStop(2097152);
 BA.debugLineNum = 151;BA.debugLine="Try";
Debug.ShouldStop(4194304);
try { BA.debugLineNum = 152;BA.debugLine="bs1.stopScanning";
Debug.ShouldStop(8388608);
appmain.mostCurrent._bs1.runVoidMethod ("stopScanning");
 Debug.CheckDeviceExceptions();
} 
       catch (Exception e4) {
			BA.rdebugUtils.runVoidMethod("setLastException",appmain.processBA, e4.toString()); };
 BA.debugLineNum = 155;BA.debugLine="End Sub";
Debug.ShouldStop(67108864);
return RemoteObject.createImmutable("");
}
catch (Exception e) {
			throw Debug.ErrorCaught(e);
		} 
finally {
			Debug.PopSubsStack();
		}}
public static RemoteObject  _datediff(RemoteObject _units,RemoteObject _date1,RemoteObject _date2) throws Exception{
try {
		Debug.PushSubsStack("DateDiff (appmain) ","appmain",6,appmain.mostCurrent.activityBA,appmain.mostCurrent,103);
if (RapidSub.canDelegate("datediff")) { return shub.dpm.appmain.remoteMe.runUserSub(false, "appmain","datediff", _units, _date1, _date2);}
RemoteObject _x = RemoteObject.createImmutable(0L);
RemoteObject _y = RemoteObject.createImmutable(0L);
RemoteObject _z = RemoteObject.createImmutable(0L);
Debug.locals.put("units", _units);
Debug.locals.put("date1", _date1);
Debug.locals.put("date2", _date2);
 BA.debugLineNum = 103;BA.debugLine="Sub DateDiff (units, date1, date2)";
Debug.ShouldStop(64);
 BA.debugLineNum = 104;BA.debugLine="Try";
Debug.ShouldStop(128);
try { BA.debugLineNum = 105;BA.debugLine="Dim x As Long";
Debug.ShouldStop(256);
_x = RemoteObject.createImmutable(0L);Debug.locals.put("x", _x);
 BA.debugLineNum = 106;BA.debugLine="Dim y As Long";
Debug.ShouldStop(512);
_y = RemoteObject.createImmutable(0L);Debug.locals.put("y", _y);
 BA.debugLineNum = 107;BA.debugLine="Dim z As Long";
Debug.ShouldStop(1024);
_z = RemoteObject.createImmutable(0L);Debug.locals.put("z", _z);
 BA.debugLineNum = 108;BA.debugLine="x=DateTime.DateParse(date1)";
Debug.ShouldStop(2048);
_x = appmain.mostCurrent.__c.getField(false,"DateTime").runMethod(true,"DateParse",(Object)(_date1));Debug.locals.put("x", _x);
 BA.debugLineNum = 109;BA.debugLine="y=DateTime.DateParse(date2)";
Debug.ShouldStop(4096);
_y = appmain.mostCurrent.__c.getField(false,"DateTime").runMethod(true,"DateParse",(Object)(_date2));Debug.locals.put("y", _y);
 BA.debugLineNum = 110;BA.debugLine="Select units";
Debug.ShouldStop(8192);
switch (BA.switchObjectToInt(_units,BA.ObjectToString("ss"))) {
case 0: {
 BA.debugLineNum = 112;BA.debugLine="z=60";
Debug.ShouldStop(32768);
_z = BA.numberCast(long.class, 60);Debug.locals.put("z", _z);
 break; }
}
;
 BA.debugLineNum = 115;BA.debugLine="Return (y-x) / z";
Debug.ShouldStop(262144);
Debug.CheckDeviceExceptions();if (true) return BA.NumberToString(RemoteObject.solve(new RemoteObject[] {(RemoteObject.solve(new RemoteObject[] {_y,_x}, "-",1, 2)),_z}, "/",0, 0));
 Debug.CheckDeviceExceptions();
} 
       catch (Exception e13) {
			BA.rdebugUtils.runVoidMethod("setLastException",appmain.processBA, e13.toString()); BA.debugLineNum = 117;BA.debugLine="Return 10";
Debug.ShouldStop(1048576);
if (true) return BA.NumberToString(10);
 };
 BA.debugLineNum = 121;BA.debugLine="End Sub";
Debug.ShouldStop(16777216);
return RemoteObject.createImmutable("");
}
catch (Exception e) {
			throw Debug.ErrorCaught(e);
		} 
finally {
			Debug.PopSubsStack();
		}}
public static RemoteObject  _get_params() throws Exception{
try {
		Debug.PushSubsStack("Get_Params (appmain) ","appmain",6,appmain.mostCurrent.activityBA,appmain.mostCurrent,83);
if (RapidSub.canDelegate("get_params")) { return shub.dpm.appmain.remoteMe.runUserSub(false, "appmain","get_params");}
RemoteObject _tr = RemoteObject.declareNull("anywheresoftware.b4a.objects.streams.File.TextReaderWrapper");
RemoteObject _inp = RemoteObject.declareNull("anywheresoftware.b4a.objects.streams.File.InputStreamWrapper");
 BA.debugLineNum = 83;BA.debugLine="Sub Get_Params";
Debug.ShouldStop(262144);
 BA.debugLineNum = 84;BA.debugLine="Dim TR As TextReader";
Debug.ShouldStop(524288);
_tr = RemoteObject.createNew ("anywheresoftware.b4a.objects.streams.File.TextReaderWrapper");Debug.locals.put("TR", _tr);
 BA.debugLineNum = 85;BA.debugLine="Dim inp As InputStream";
Debug.ShouldStop(1048576);
_inp = RemoteObject.createNew ("anywheresoftware.b4a.objects.streams.File.InputStreamWrapper");Debug.locals.put("inp", _inp);
 BA.debugLineNum = 86;BA.debugLine="inp=File.OpenInput(File.DirInternal , \"DPM.ini\")";
Debug.ShouldStop(2097152);
_inp = appmain.mostCurrent.__c.getField(false,"File").runMethod(false,"OpenInput",(Object)(appmain.mostCurrent.__c.getField(false,"File").runMethod(true,"getDirInternal")),(Object)(RemoteObject.createImmutable("DPM.ini")));Debug.locals.put("inp", _inp);
 BA.debugLineNum = 87;BA.debugLine="TR.Initialize(inp)";
Debug.ShouldStop(4194304);
_tr.runVoidMethod ("Initialize",(Object)((_inp.getObject())));
 BA.debugLineNum = 88;BA.debugLine="Try";
Debug.ShouldStop(8388608);
try { BA.debugLineNum = 89;BA.debugLine="sURL=TR.Readline";
Debug.ShouldStop(16777216);
appmain._surl = _tr.runMethod(true,"ReadLine");
 Debug.CheckDeviceExceptions();
} 
       catch (Exception e8) {
			BA.rdebugUtils.runVoidMethod("setLastException",appmain.processBA, e8.toString()); BA.debugLineNum = 91;BA.debugLine="sURL=\"\"";
Debug.ShouldStop(67108864);
appmain._surl = BA.ObjectToString("");
 };
 BA.debugLineNum = 93;BA.debugLine="Try";
Debug.ShouldStop(268435456);
try { BA.debugLineNum = 94;BA.debugLine="timeout = TR.ReadLine";
Debug.ShouldStop(536870912);
appmain._timeout = BA.numberCast(long.class, _tr.runMethod(true,"ReadLine"));
 Debug.CheckDeviceExceptions();
} 
       catch (Exception e13) {
			BA.rdebugUtils.runVoidMethod("setLastException",appmain.processBA, e13.toString()); BA.debugLineNum = 97;BA.debugLine="timeout=30000";
Debug.ShouldStop(1);
appmain._timeout = BA.numberCast(long.class, 30000);
 };
 BA.debugLineNum = 100;BA.debugLine="TR.Close";
Debug.ShouldStop(8);
_tr.runVoidMethod ("Close");
 BA.debugLineNum = 101;BA.debugLine="End Sub";
Debug.ShouldStop(16);
return RemoteObject.createImmutable("");
}
catch (Exception e) {
			throw Debug.ErrorCaught(e);
		} 
finally {
			Debug.PopSubsStack();
		}}
public static RemoteObject  _get_pat(RemoteObject _id) throws Exception{
try {
		Debug.PushSubsStack("get_Pat (appmain) ","appmain",6,appmain.mostCurrent.activityBA,appmain.mostCurrent,158);
if (RapidSub.canDelegate("get_pat")) { return shub.dpm.appmain.remoteMe.runUserSub(false, "appmain","get_pat", _id);}
RemoteObject _job = RemoteObject.declareNull("shub.dpm.httpjob");
RemoteObject _callurl = RemoteObject.createImmutable("");
Debug.locals.put("id", _id);
 BA.debugLineNum = 158;BA.debugLine="Sub get_Pat(id As String)";
Debug.ShouldStop(536870912);
 BA.debugLineNum = 159;BA.debugLine="Dim job As HttpJob";
Debug.ShouldStop(1073741824);
_job = RemoteObject.createNew ("shub.dpm.httpjob");Debug.locals.put("job", _job);
 BA.debugLineNum = 160;BA.debugLine="JobName=\"GetPat\"";
Debug.ShouldStop(-2147483648);
appmain.mostCurrent._jobname = BA.ObjectToString("GetPat");
 BA.debugLineNum = 161;BA.debugLine="job.Initialize(JobName, Me)";
Debug.ShouldStop(1);
_job.runClassMethod (shub.dpm.httpjob.class, "_initialize" /*RemoteObject*/ ,appmain.processBA,(Object)(appmain.mostCurrent._jobname),(Object)(appmain.getObject()));
 BA.debugLineNum = 163;BA.debugLine="Dim callurl As String";
Debug.ShouldStop(4);
_callurl = RemoteObject.createImmutable("");Debug.locals.put("callurl", _callurl);
 BA.debugLineNum = 164;BA.debugLine="callurl=sURL&\"/DPMService/api/Service_View_Pat/\"&";
Debug.ShouldStop(8);
_callurl = RemoteObject.concat(appmain._surl,RemoteObject.createImmutable("/DPMService/api/Service_View_Pat/"),_id);Debug.locals.put("callurl", _callurl);
 BA.debugLineNum = 165;BA.debugLine="job.Download(callurl)";
Debug.ShouldStop(16);
_job.runClassMethod (shub.dpm.httpjob.class, "_download" /*RemoteObject*/ ,(Object)(_callurl));
 BA.debugLineNum = 168;BA.debugLine="End Sub";
Debug.ShouldStop(128);
return RemoteObject.createImmutable("");
}
catch (Exception e) {
			throw Debug.ErrorCaught(e);
		} 
finally {
			Debug.PopSubsStack();
		}}
public static RemoteObject  _globals() throws Exception{
 //BA.debugLineNum = 14;BA.debugLine="Sub Globals";
 //BA.debugLineNum = 18;BA.debugLine="Private bs1 As BillScanner";
appmain.mostCurrent._bs1 = RemoteObject.createNew ("billwrapper.billWrapper");
 //BA.debugLineNum = 19;BA.debugLine="Private Button1 As Button";
appmain.mostCurrent._button1 = RemoteObject.createNew ("anywheresoftware.b4a.objects.ButtonWrapper");
 //BA.debugLineNum = 21;BA.debugLine="Private Button2 As Button";
appmain.mostCurrent._button2 = RemoteObject.createNew ("anywheresoftware.b4a.objects.ButtonWrapper");
 //BA.debugLineNum = 22;BA.debugLine="Dim JobName As String";
appmain.mostCurrent._jobname = RemoteObject.createImmutable("");
 //BA.debugLineNum = 24;BA.debugLine="Dim PatName As String";
appmain.mostCurrent._patname = RemoteObject.createImmutable("");
 //BA.debugLineNum = 25;BA.debugLine="Private txtPatNr As EditText";
appmain.mostCurrent._txtpatnr = RemoteObject.createNew ("anywheresoftware.b4a.objects.EditTextWrapper");
 //BA.debugLineNum = 26;BA.debugLine="Private pnlEnterPatID As Panel";
appmain.mostCurrent._pnlenterpatid = RemoteObject.createNew ("anywheresoftware.b4a.objects.PanelWrapper");
 //BA.debugLineNum = 27;BA.debugLine="Private lblPatient As Label";
appmain.mostCurrent._lblpatient = RemoteObject.createNew ("anywheresoftware.b4a.objects.LabelWrapper");
 //BA.debugLineNum = 28;BA.debugLine="Private timeout As Long";
appmain._timeout = RemoteObject.createImmutable(0L);
 //BA.debugLineNum = 30;BA.debugLine="Private dtnow As Long";
appmain._dtnow = RemoteObject.createImmutable(0L);
 //BA.debugLineNum = 32;BA.debugLine="Private btnSearchPat As Button";
appmain.mostCurrent._btnsearchpat = RemoteObject.createNew ("anywheresoftware.b4a.objects.ButtonWrapper");
 //BA.debugLineNum = 33;BA.debugLine="Dim PatTimer As Timer";
appmain.mostCurrent._pattimer = RemoteObject.createNew ("anywheresoftware.b4a.objects.Timer");
 //BA.debugLineNum = 34;BA.debugLine="Dim StartTimer As Timer";
appmain.mostCurrent._starttimer = RemoteObject.createNew ("anywheresoftware.b4a.objects.Timer");
 //BA.debugLineNum = 35;BA.debugLine="End Sub";
return RemoteObject.createImmutable("");
}
public static RemoteObject  _jobdone(RemoteObject _job) throws Exception{
try {
		Debug.PushSubsStack("JobDone (appmain) ","appmain",6,appmain.mostCurrent.activityBA,appmain.mostCurrent,171);
if (RapidSub.canDelegate("jobdone")) { return shub.dpm.appmain.remoteMe.runUserSub(false, "appmain","jobdone", _job);}
RemoteObject _res = RemoteObject.createImmutable("");
RemoteObject _parser = RemoteObject.declareNull("anywheresoftware.b4a.objects.collections.JSONParser");
RemoteObject _list1 = RemoteObject.declareNull("anywheresoftware.b4a.objects.collections.List");
RemoteObject _map1 = RemoteObject.declareNull("anywheresoftware.b4a.objects.collections.Map");
Debug.locals.put("Job", _job);
 BA.debugLineNum = 171;BA.debugLine="Sub JobDone(Job As HttpJob)";
Debug.ShouldStop(1024);
 BA.debugLineNum = 172;BA.debugLine="ProgressDialogHide";
Debug.ShouldStop(2048);
appmain.mostCurrent.__c.runVoidMethod ("ProgressDialogHide");
 BA.debugLineNum = 173;BA.debugLine="If Job.Success Then";
Debug.ShouldStop(4096);
if (_job.getField(true,"_success" /*RemoteObject*/ ).<Boolean>get().booleanValue()) { 
 BA.debugLineNum = 174;BA.debugLine="Dim res As String";
Debug.ShouldStop(8192);
_res = RemoteObject.createImmutable("");Debug.locals.put("res", _res);
 BA.debugLineNum = 175;BA.debugLine="res = Job.GetString";
Debug.ShouldStop(16384);
_res = _job.runClassMethod (shub.dpm.httpjob.class, "_getstring" /*RemoteObject*/ );Debug.locals.put("res", _res);
 BA.debugLineNum = 176;BA.debugLine="Dim parser As JSONParser";
Debug.ShouldStop(32768);
_parser = RemoteObject.createNew ("anywheresoftware.b4a.objects.collections.JSONParser");Debug.locals.put("parser", _parser);
 BA.debugLineNum = 177;BA.debugLine="parser.Initialize(res)";
Debug.ShouldStop(65536);
_parser.runVoidMethod ("Initialize",(Object)(_res));
 BA.debugLineNum = 179;BA.debugLine="Log(\"Response from server: \" & res)";
Debug.ShouldStop(262144);
appmain.mostCurrent.__c.runVoidMethod ("LogImpl","73670024",RemoteObject.concat(RemoteObject.createImmutable("Response from server: "),_res),0);
 BA.debugLineNum = 181;BA.debugLine="Select Job.JobName";
Debug.ShouldStop(1048576);
switch (BA.switchObjectToInt(_job.getField(true,"_jobname" /*RemoteObject*/ ),BA.ObjectToString("GetPat"),BA.ObjectToString("PostCharche"))) {
case 0: {
 BA.debugLineNum = 184;BA.debugLine="Dim list1 As List";
Debug.ShouldStop(8388608);
_list1 = RemoteObject.createNew ("anywheresoftware.b4a.objects.collections.List");Debug.locals.put("list1", _list1);
 BA.debugLineNum = 185;BA.debugLine="list1 = parser.NextArray";
Debug.ShouldStop(16777216);
_list1 = _parser.runMethod(false,"NextArray");Debug.locals.put("list1", _list1);
 BA.debugLineNum = 186;BA.debugLine="If list1.Size<1 Then";
Debug.ShouldStop(33554432);
if (RemoteObject.solveBoolean("<",_list1.runMethod(true,"getSize"),BA.numberCast(double.class, 1))) { 
 BA.debugLineNum = 187;BA.debugLine="ToastMessageShow(\"Patient nicht vorhanden.\",T";
Debug.ShouldStop(67108864);
appmain.mostCurrent.__c.runVoidMethod ("ToastMessageShow",(Object)(BA.ObjectToCharSequence("Patient nicht vorhanden.")),(Object)(appmain.mostCurrent.__c.getField(true,"True")));
 BA.debugLineNum = 188;BA.debugLine="pnlEnterPatID.Visible=True";
Debug.ShouldStop(134217728);
appmain.mostCurrent._pnlenterpatid.runMethod(true,"setVisible",appmain.mostCurrent.__c.getField(true,"True"));
 BA.debugLineNum = 189;BA.debugLine="Return";
Debug.ShouldStop(268435456);
if (true) return RemoteObject.createImmutable("");
 };
 BA.debugLineNum = 191;BA.debugLine="Dim map1 As Map";
Debug.ShouldStop(1073741824);
_map1 = RemoteObject.createNew ("anywheresoftware.b4a.objects.collections.Map");Debug.locals.put("map1", _map1);
 BA.debugLineNum = 192;BA.debugLine="map1 = list1.Get(0)";
Debug.ShouldStop(-2147483648);
_map1 = RemoteObject.declareNull("anywheresoftware.b4a.AbsObjectWrapper").runMethod(false, "ConvertToWrapper", RemoteObject.createNew("anywheresoftware.b4a.objects.collections.Map"), _list1.runMethod(false,"Get",(Object)(BA.numberCast(int.class, 0))));
 BA.debugLineNum = 193;BA.debugLine="Log(map1)";
Debug.ShouldStop(1);
appmain.mostCurrent.__c.runVoidMethod ("LogImpl","73670038",BA.ObjectToString(_map1),0);
 BA.debugLineNum = 195;BA.debugLine="PatID = map1.Get(\"id\")";
Debug.ShouldStop(4);
appmain._patid = BA.ObjectToString(_map1.runMethod(false,"Get",(Object)((RemoteObject.createImmutable("id")))));
 BA.debugLineNum = 196;BA.debugLine="PatName=map1.Get(\"pat\")";
Debug.ShouldStop(8);
appmain.mostCurrent._patname = BA.ObjectToString(_map1.runMethod(false,"Get",(Object)((RemoteObject.createImmutable("pat")))));
 BA.debugLineNum = 197;BA.debugLine="lblPatient.Text=PatName";
Debug.ShouldStop(16);
appmain.mostCurrent._lblpatient.runMethod(true,"setText",BA.ObjectToCharSequence(appmain.mostCurrent._patname));
 break; }
case 1: {
 BA.debugLineNum = 199;BA.debugLine="ToastMessageShow(\"Barcode erfolgreich gespeich";
Debug.ShouldStop(64);
appmain.mostCurrent.__c.runVoidMethod ("ToastMessageShow",(Object)(BA.ObjectToCharSequence("Barcode erfolgreich gespeichert")),(Object)(appmain.mostCurrent.__c.getField(true,"False")));
 break; }
}
;
 }else {
 BA.debugLineNum = 202;BA.debugLine="ToastMessageShow(\"Funktionsaufruf fehlgeschlagen";
Debug.ShouldStop(512);
appmain.mostCurrent.__c.runVoidMethod ("ToastMessageShow",(Object)(BA.ObjectToCharSequence("Funktionsaufruf fehlgeschlagen.")),(Object)(appmain.mostCurrent.__c.getField(true,"True")));
 };
 BA.debugLineNum = 204;BA.debugLine="Job.Release";
Debug.ShouldStop(2048);
_job.runClassMethod (shub.dpm.httpjob.class, "_release" /*RemoteObject*/ );
 BA.debugLineNum = 205;BA.debugLine="End Sub";
Debug.ShouldStop(4096);
return RemoteObject.createImmutable("");
}
catch (Exception e) {
			throw Debug.ErrorCaught(e);
		} 
finally {
			Debug.PopSubsStack();
		}}
public static RemoteObject  _lblpatient_longclick() throws Exception{
try {
		Debug.PushSubsStack("lblPatient_LongClick (appmain) ","appmain",6,appmain.mostCurrent.activityBA,appmain.mostCurrent,224);
if (RapidSub.canDelegate("lblpatient_longclick")) { return shub.dpm.appmain.remoteMe.runUserSub(false, "appmain","lblpatient_longclick");}
 BA.debugLineNum = 224;BA.debugLine="Private Sub lblPatient_LongClick";
Debug.ShouldStop(-2147483648);
 BA.debugLineNum = 225;BA.debugLine="StartActivity(\"Param\")";
Debug.ShouldStop(1);
appmain.mostCurrent.__c.runVoidMethod ("StartActivity",appmain.processBA,(Object)((RemoteObject.createImmutable("Param"))));
 BA.debugLineNum = 226;BA.debugLine="End Sub";
Debug.ShouldStop(2);
return RemoteObject.createImmutable("");
}
catch (Exception e) {
			throw Debug.ErrorCaught(e);
		} 
finally {
			Debug.PopSubsStack();
		}}
public static RemoteObject  _process_globals() throws Exception{
 //BA.debugLineNum = 6;BA.debugLine="Sub Process_Globals";
 //BA.debugLineNum = 9;BA.debugLine="Public PatID As String";
appmain._patid = RemoteObject.createImmutable("");
 //BA.debugLineNum = 10;BA.debugLine="Public sURL As String=\"\"";
appmain._surl = BA.ObjectToString("");
 //BA.debugLineNum = 12;BA.debugLine="End Sub";
return RemoteObject.createImmutable("");
}
public static RemoteObject  _timer_tick() throws Exception{
try {
		Debug.PushSubsStack("Timer_Tick (appmain) ","appmain",6,appmain.mostCurrent.activityBA,appmain.mostCurrent,78);
if (RapidSub.canDelegate("timer_tick")) { return shub.dpm.appmain.remoteMe.runUserSub(false, "appmain","timer_tick");}
 BA.debugLineNum = 78;BA.debugLine="Sub Timer_Tick";
Debug.ShouldStop(8192);
 BA.debugLineNum = 79;BA.debugLine="PatID=0";
Debug.ShouldStop(16384);
appmain._patid = BA.NumberToString(0);
 BA.debugLineNum = 80;BA.debugLine="lblPatient.Text=\"Bitte Patient auswählen\"";
Debug.ShouldStop(32768);
appmain.mostCurrent._lblpatient.runMethod(true,"setText",BA.ObjectToCharSequence("Bitte Patient auswählen"));
 BA.debugLineNum = 81;BA.debugLine="End Sub";
Debug.ShouldStop(65536);
return RemoteObject.createImmutable("");
}
catch (Exception e) {
			throw Debug.ErrorCaught(e);
		} 
finally {
			Debug.PopSubsStack();
		}}
}