package shub.dpm;

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

public class allgfnkt_subs_0 {


public static RemoteObject  _get_params(RemoteObject _ba,RemoteObject _param) throws Exception{
try {
		Debug.PushSubsStack("Get_Params (allgfnkt) ","allgfnkt",5,_ba,allgfnkt.mostCurrent,19);
if (RapidSub.canDelegate("get_params")) { return shub.dpm.allgfnkt.remoteMe.runUserSub(false, "allgfnkt","get_params", _ba, _param);}
RemoteObject _result = RemoteObject.createImmutable("");
RemoteObject _tr = RemoteObject.declareNull("anywheresoftware.b4a.objects.streams.File.TextReaderWrapper");
RemoteObject _inp = RemoteObject.declareNull("anywheresoftware.b4a.objects.streams.File.InputStreamWrapper");
;
Debug.locals.put("Param", _param);
 BA.debugLineNum = 19;BA.debugLine="Sub Get_Params(Param As String) As String";
Debug.ShouldStop(262144);
 BA.debugLineNum = 20;BA.debugLine="Try";
Debug.ShouldStop(524288);
try { BA.debugLineNum = 21;BA.debugLine="Dim result As String";
Debug.ShouldStop(1048576);
_result = RemoteObject.createImmutable("");Debug.locals.put("result", _result);
 BA.debugLineNum = 22;BA.debugLine="Dim TR As TextReader";
Debug.ShouldStop(2097152);
_tr = RemoteObject.createNew ("anywheresoftware.b4a.objects.streams.File.TextReaderWrapper");Debug.locals.put("TR", _tr);
 BA.debugLineNum = 23;BA.debugLine="Dim inp As InputStream";
Debug.ShouldStop(4194304);
_inp = RemoteObject.createNew ("anywheresoftware.b4a.objects.streams.File.InputStreamWrapper");Debug.locals.put("inp", _inp);
 BA.debugLineNum = 24;BA.debugLine="inp=File.OpenInput(File.DirInternal , \"DPM.ini\")";
Debug.ShouldStop(8388608);
_inp = allgfnkt.mostCurrent.__c.getField(false,"File").runMethod(false,"OpenInput",(Object)(allgfnkt.mostCurrent.__c.getField(false,"File").runMethod(true,"getDirInternal")),(Object)(RemoteObject.createImmutable("DPM.ini")));Debug.locals.put("inp", _inp);
 BA.debugLineNum = 25;BA.debugLine="TR.Initialize(inp)";
Debug.ShouldStop(16777216);
_tr.runVoidMethod ("Initialize",(Object)((_inp.getObject())));
 BA.debugLineNum = 26;BA.debugLine="If Param=\"URL\" Then";
Debug.ShouldStop(33554432);
if (RemoteObject.solveBoolean("=",_param,BA.ObjectToString("URL"))) { 
 BA.debugLineNum = 27;BA.debugLine="Try";
Debug.ShouldStop(67108864);
try { BA.debugLineNum = 28;BA.debugLine="result= TR.Readline";
Debug.ShouldStop(134217728);
_result = _tr.runMethod(true,"ReadLine");Debug.locals.put("result", _result);
 Debug.CheckDeviceExceptions();
} 
       catch (Exception e11) {
			BA.rdebugUtils.runVoidMethod("setLastException",BA.rdebugUtils.runMethod(false, "processBAFromBA", _ba), e11.toString()); BA.debugLineNum = 30;BA.debugLine="result=\"\"";
Debug.ShouldStop(536870912);
_result = BA.ObjectToString("");Debug.locals.put("result", _result);
 };
 };
 BA.debugLineNum = 33;BA.debugLine="If Param=\"TIMER\" Then";
Debug.ShouldStop(1);
if (RemoteObject.solveBoolean("=",_param,BA.ObjectToString("TIMER"))) { 
 BA.debugLineNum = 34;BA.debugLine="Try";
Debug.ShouldStop(2);
try { BA.debugLineNum = 35;BA.debugLine="result=TR.Readline";
Debug.ShouldStop(4);
_result = _tr.runMethod(true,"ReadLine");Debug.locals.put("result", _result);
 BA.debugLineNum = 36;BA.debugLine="result=TR.ReadLine";
Debug.ShouldStop(8);
_result = _tr.runMethod(true,"ReadLine");Debug.locals.put("result", _result);
 Debug.CheckDeviceExceptions();
} 
       catch (Exception e19) {
			BA.rdebugUtils.runVoidMethod("setLastException",BA.rdebugUtils.runMethod(false, "processBAFromBA", _ba), e19.toString()); BA.debugLineNum = 38;BA.debugLine="result=\"\"";
Debug.ShouldStop(32);
_result = BA.ObjectToString("");Debug.locals.put("result", _result);
 };
 };
 BA.debugLineNum = 41;BA.debugLine="TR.Close";
Debug.ShouldStop(256);
_tr.runVoidMethod ("Close");
 BA.debugLineNum = 42;BA.debugLine="Return result";
Debug.ShouldStop(512);
Debug.CheckDeviceExceptions();if (true) return _result;
 Debug.CheckDeviceExceptions();
} 
       catch (Exception e25) {
			BA.rdebugUtils.runVoidMethod("setLastException",BA.rdebugUtils.runMethod(false, "processBAFromBA", _ba), e25.toString()); };
 BA.debugLineNum = 45;BA.debugLine="End Sub";
Debug.ShouldStop(4096);
return RemoteObject.createImmutable("");
}
catch (Exception e) {
			throw Debug.ErrorCaught(e);
		} 
finally {
			Debug.PopSubsStack();
		}}
public static RemoteObject  _geturl(RemoteObject _ba,RemoteObject _param1,RemoteObject _param2) throws Exception{
try {
		Debug.PushSubsStack("GetURL (allgfnkt) ","allgfnkt",5,_ba,allgfnkt.mostCurrent,60);
if (RapidSub.canDelegate("geturl")) { return shub.dpm.allgfnkt.remoteMe.runUserSub(false, "allgfnkt","geturl", _ba, _param1, _param2);}
RemoteObject _apipath = RemoteObject.createImmutable("");
;
Debug.locals.put("param1", _param1);
Debug.locals.put("param2", _param2);
 BA.debugLineNum = 60;BA.debugLine="Public Sub GetURL(param1 As String, param2 As Stri";
Debug.ShouldStop(134217728);
 BA.debugLineNum = 61;BA.debugLine="Dim apipath As String=\"\"";
Debug.ShouldStop(268435456);
_apipath = BA.ObjectToString("");Debug.locals.put("apipath", _apipath);Debug.locals.put("apipath", _apipath);
 BA.debugLineNum = 62;BA.debugLine="Select Case Jobname";
Debug.ShouldStop(536870912);
switch (BA.switchObjectToInt(allgfnkt._jobname,BA.ObjectToString("GetPat"),BA.ObjectToString("GetPatName"))) {
case 0: {
 BA.debugLineNum = 64;BA.debugLine="apipath=\"/DPMService/api/Service_View_Pat\"";
Debug.ShouldStop(-2147483648);
_apipath = BA.ObjectToString("/DPMService/api/Service_View_Pat");Debug.locals.put("apipath", _apipath);
 break; }
case 1: {
 BA.debugLineNum = 67;BA.debugLine="apipath=\"/DPMService/api/Service_View_Pat/searc";
Debug.ShouldStop(4);
_apipath = BA.ObjectToString("/DPMService/api/Service_View_Pat/search");Debug.locals.put("apipath", _apipath);
 break; }
}
;
 BA.debugLineNum = 69;BA.debugLine="If param1<>\"\" Then apipath=apipath&\"/\"&param1";
Debug.ShouldStop(16);
if (RemoteObject.solveBoolean("!",_param1,BA.ObjectToString(""))) { 
_apipath = RemoteObject.concat(_apipath,RemoteObject.createImmutable("/"),_param1);Debug.locals.put("apipath", _apipath);};
 BA.debugLineNum = 70;BA.debugLine="If param2<>\"\" Then apipath=apipath&\"/\"&param2";
Debug.ShouldStop(32);
if (RemoteObject.solveBoolean("!",_param2,BA.ObjectToString(""))) { 
_apipath = RemoteObject.concat(_apipath,RemoteObject.createImmutable("/"),_param2);Debug.locals.put("apipath", _apipath);};
 BA.debugLineNum = 72;BA.debugLine="Return sURL&apipath";
Debug.ShouldStop(128);
if (true) return RemoteObject.concat(allgfnkt._surl,_apipath);
 BA.debugLineNum = 73;BA.debugLine="End Sub";
Debug.ShouldStop(256);
return RemoteObject.createImmutable("");
}
catch (Exception e) {
			throw Debug.ErrorCaught(e);
		} 
finally {
			Debug.PopSubsStack();
		}}
public static RemoteObject  _process_globals() throws Exception{
 //BA.debugLineNum = 3;BA.debugLine="Sub Process_Globals";
 //BA.debugLineNum = 6;BA.debugLine="Public PatID As String";
allgfnkt._patid = RemoteObject.createImmutable("");
 //BA.debugLineNum = 7;BA.debugLine="Public PID As String";
allgfnkt._pid = RemoteObject.createImmutable("");
 //BA.debugLineNum = 8;BA.debugLine="Public sURL As String=\"\"";
allgfnkt._surl = BA.ObjectToString("");
 //BA.debugLineNum = 9;BA.debugLine="Public ResettimerInterval As Int";
allgfnkt._resettimerinterval = RemoteObject.createImmutable(0);
 //BA.debugLineNum = 10;BA.debugLine="Public Jobname As String";
allgfnkt._jobname = RemoteObject.createImmutable("");
 //BA.debugLineNum = 11;BA.debugLine="Public PatName As String";
allgfnkt._patname = RemoteObject.createImmutable("");
 //BA.debugLineNum = 12;BA.debugLine="Public JobEnabled As Boolean=False";
allgfnkt._jobenabled = allgfnkt.mostCurrent.__c.getField(true,"False");
 //BA.debugLineNum = 13;BA.debugLine="Public Searchstring As String";
allgfnkt._searchstring = RemoteObject.createImmutable("");
 //BA.debugLineNum = 14;BA.debugLine="Public apikey As String=\"BgWSbwCNM3pEiCxgIlDEyD7H";
allgfnkt._apikey = BA.ObjectToString("BgWSbwCNM3pEiCxgIlDEyD7HFpUgKPeL8OPDqH9n");
 //BA.debugLineNum = 15;BA.debugLine="Public resultlist As List";
allgfnkt._resultlist = RemoteObject.createNew ("anywheresoftware.b4a.objects.collections.List");
 //BA.debugLineNum = 17;BA.debugLine="End Sub";
return RemoteObject.createImmutable("");
}
public static RemoteObject  _save_parameter(RemoteObject _ba,RemoteObject _url,RemoteObject _append) throws Exception{
try {
		Debug.PushSubsStack("Save_Parameter (allgfnkt) ","allgfnkt",5,_ba,allgfnkt.mostCurrent,47);
if (RapidSub.canDelegate("save_parameter")) { return shub.dpm.allgfnkt.remoteMe.runUserSub(false, "allgfnkt","save_parameter", _ba, _url, _append);}
RemoteObject _tw = RemoteObject.declareNull("anywheresoftware.b4a.objects.streams.File.TextWriterWrapper");
RemoteObject _out = RemoteObject.declareNull("anywheresoftware.b4a.objects.streams.File.OutputStreamWrapper");
;
Debug.locals.put("url", _url);
Debug.locals.put("append", _append);
 BA.debugLineNum = 47;BA.debugLine="Sub Save_Parameter(url As String,append As Boolean";
Debug.ShouldStop(16384);
 BA.debugLineNum = 48;BA.debugLine="Dim Tw As TextWriter";
Debug.ShouldStop(32768);
_tw = RemoteObject.createNew ("anywheresoftware.b4a.objects.streams.File.TextWriterWrapper");Debug.locals.put("Tw", _tw);
 BA.debugLineNum = 49;BA.debugLine="Dim out As OutputStream";
Debug.ShouldStop(65536);
_out = RemoteObject.createNew ("anywheresoftware.b4a.objects.streams.File.OutputStreamWrapper");Debug.locals.put("out", _out);
 BA.debugLineNum = 51;BA.debugLine="out = File.OpenOutput(File.DirInternal , \"DPM.ini";
Debug.ShouldStop(262144);
_out = allgfnkt.mostCurrent.__c.getField(false,"File").runMethod(false,"OpenOutput",(Object)(allgfnkt.mostCurrent.__c.getField(false,"File").runMethod(true,"getDirInternal")),(Object)(BA.ObjectToString("DPM.ini")),(Object)(_append));Debug.locals.put("out", _out);
 BA.debugLineNum = 52;BA.debugLine="Tw.Initialize(out)";
Debug.ShouldStop(524288);
_tw.runVoidMethod ("Initialize",(Object)((_out.getObject())));
 BA.debugLineNum = 54;BA.debugLine="Tw.WriteLine(url)";
Debug.ShouldStop(2097152);
_tw.runVoidMethod ("WriteLine",(Object)(_url));
 BA.debugLineNum = 55;BA.debugLine="Tw.Flush";
Debug.ShouldStop(4194304);
_tw.runVoidMethod ("Flush");
 BA.debugLineNum = 56;BA.debugLine="Tw.close";
Debug.ShouldStop(8388608);
_tw.runVoidMethod ("Close");
 BA.debugLineNum = 58;BA.debugLine="End Sub";
Debug.ShouldStop(33554432);
return RemoteObject.createImmutable("");
}
catch (Exception e) {
			throw Debug.ErrorCaught(e);
		} 
finally {
			Debug.PopSubsStack();
		}}
}