package shub.dpm;


import anywheresoftware.b4a.BA;
import anywheresoftware.b4a.BALayout;
import anywheresoftware.b4a.debug.*;

public class allgfnkt {
private static allgfnkt mostCurrent = new allgfnkt();
public static Object getObject() {
    throw new RuntimeException("Code module does not support this method.");
}
 
public anywheresoftware.b4a.keywords.Common __c = null;
public static String _patid = "";
public static String _pid = "";
public static String _surl = "";
public static int _resettimerinterval = 0;
public static String _jobname = "";
public static String _patname = "";
public static boolean _jobenabled = false;
public static String _searchstring = "";
public static String _apikey = "";
public static anywheresoftware.b4a.objects.collections.List _resultlist = null;
public shub.dpm.main _main = null;
public shub.dpm.parameter _parameter = null;
public shub.dpm.about _about = null;
public shub.dpm.barcodescanner _barcodescanner = null;
public shub.dpm.listpat _listpat = null;
public shub.dpm.endecodetester _endecodetester = null;
public shub.dpm.jobservice _jobservice = null;
public shub.dpm.listdata _listdata = null;
public shub.dpm.starter _starter = null;
public shub.dpm.b4xpages _b4xpages = null;
public shub.dpm.b4xcollections _b4xcollections = null;
public shub.dpm.httputils2service _httputils2service = null;
public static String  _get_params(anywheresoftware.b4a.BA _ba,String _param) throws Exception{
RDebugUtils.currentModule="allgfnkt";
if (Debug.shouldDelegate(null, "get_params", false))
	 {return ((String) Debug.delegate(null, "get_params", new Object[] {_ba,_param}));}
String _result = "";
anywheresoftware.b4a.objects.streams.File.TextReaderWrapper _tr = null;
anywheresoftware.b4a.objects.streams.File.InputStreamWrapper _inp = null;
RDebugUtils.currentLine=2883584;
 //BA.debugLineNum = 2883584;BA.debugLine="Sub Get_Params(Param As String) As String";
RDebugUtils.currentLine=2883585;
 //BA.debugLineNum = 2883585;BA.debugLine="Try";
try {RDebugUtils.currentLine=2883586;
 //BA.debugLineNum = 2883586;BA.debugLine="Dim result As String";
_result = "";
RDebugUtils.currentLine=2883587;
 //BA.debugLineNum = 2883587;BA.debugLine="Dim TR As TextReader";
_tr = new anywheresoftware.b4a.objects.streams.File.TextReaderWrapper();
RDebugUtils.currentLine=2883588;
 //BA.debugLineNum = 2883588;BA.debugLine="Dim inp As InputStream";
_inp = new anywheresoftware.b4a.objects.streams.File.InputStreamWrapper();
RDebugUtils.currentLine=2883589;
 //BA.debugLineNum = 2883589;BA.debugLine="inp=File.OpenInput(File.DirInternal , \"DPM.ini\")";
_inp = anywheresoftware.b4a.keywords.Common.File.OpenInput(anywheresoftware.b4a.keywords.Common.File.getDirInternal(),"DPM.ini");
RDebugUtils.currentLine=2883590;
 //BA.debugLineNum = 2883590;BA.debugLine="TR.Initialize(inp)";
_tr.Initialize((java.io.InputStream)(_inp.getObject()));
RDebugUtils.currentLine=2883591;
 //BA.debugLineNum = 2883591;BA.debugLine="If Param=\"URL\" Then";
if ((_param).equals("URL")) { 
RDebugUtils.currentLine=2883592;
 //BA.debugLineNum = 2883592;BA.debugLine="Try";
try {RDebugUtils.currentLine=2883593;
 //BA.debugLineNum = 2883593;BA.debugLine="result= TR.Readline";
_result = _tr.ReadLine();
 } 
       catch (Exception e11) {
			(_ba.processBA == null ? _ba : _ba.processBA).setLastException(e11);RDebugUtils.currentLine=2883595;
 //BA.debugLineNum = 2883595;BA.debugLine="result=\"\"";
_result = "";
 };
 };
RDebugUtils.currentLine=2883598;
 //BA.debugLineNum = 2883598;BA.debugLine="If Param=\"TIMER\" Then";
if ((_param).equals("TIMER")) { 
RDebugUtils.currentLine=2883599;
 //BA.debugLineNum = 2883599;BA.debugLine="Try";
try {RDebugUtils.currentLine=2883600;
 //BA.debugLineNum = 2883600;BA.debugLine="result=TR.Readline";
_result = _tr.ReadLine();
RDebugUtils.currentLine=2883601;
 //BA.debugLineNum = 2883601;BA.debugLine="result=TR.ReadLine";
_result = _tr.ReadLine();
 } 
       catch (Exception e19) {
			(_ba.processBA == null ? _ba : _ba.processBA).setLastException(e19);RDebugUtils.currentLine=2883603;
 //BA.debugLineNum = 2883603;BA.debugLine="result=\"\"";
_result = "";
 };
 };
RDebugUtils.currentLine=2883606;
 //BA.debugLineNum = 2883606;BA.debugLine="TR.Close";
_tr.Close();
RDebugUtils.currentLine=2883607;
 //BA.debugLineNum = 2883607;BA.debugLine="Return result";
if (true) return _result;
 } 
       catch (Exception e25) {
			(_ba.processBA == null ? _ba : _ba.processBA).setLastException(e25); };
RDebugUtils.currentLine=2883610;
 //BA.debugLineNum = 2883610;BA.debugLine="End Sub";
return "";
}
public static String  _save_parameter(anywheresoftware.b4a.BA _ba,String _url,boolean _append) throws Exception{
RDebugUtils.currentModule="allgfnkt";
if (Debug.shouldDelegate(null, "save_parameter", false))
	 {return ((String) Debug.delegate(null, "save_parameter", new Object[] {_ba,_url,_append}));}
anywheresoftware.b4a.objects.streams.File.TextWriterWrapper _tw = null;
anywheresoftware.b4a.objects.streams.File.OutputStreamWrapper _out = null;
RDebugUtils.currentLine=2949120;
 //BA.debugLineNum = 2949120;BA.debugLine="Sub Save_Parameter(url As String,append As Boolean";
RDebugUtils.currentLine=2949121;
 //BA.debugLineNum = 2949121;BA.debugLine="Dim Tw As TextWriter";
_tw = new anywheresoftware.b4a.objects.streams.File.TextWriterWrapper();
RDebugUtils.currentLine=2949122;
 //BA.debugLineNum = 2949122;BA.debugLine="Dim out As OutputStream";
_out = new anywheresoftware.b4a.objects.streams.File.OutputStreamWrapper();
RDebugUtils.currentLine=2949124;
 //BA.debugLineNum = 2949124;BA.debugLine="out = File.OpenOutput(File.DirInternal , \"DPM.ini";
_out = anywheresoftware.b4a.keywords.Common.File.OpenOutput(anywheresoftware.b4a.keywords.Common.File.getDirInternal(),"DPM.ini",_append);
RDebugUtils.currentLine=2949125;
 //BA.debugLineNum = 2949125;BA.debugLine="Tw.Initialize(out)";
_tw.Initialize((java.io.OutputStream)(_out.getObject()));
RDebugUtils.currentLine=2949127;
 //BA.debugLineNum = 2949127;BA.debugLine="Tw.WriteLine(url)";
_tw.WriteLine(_url);
RDebugUtils.currentLine=2949128;
 //BA.debugLineNum = 2949128;BA.debugLine="Tw.Flush";
_tw.Flush();
RDebugUtils.currentLine=2949129;
 //BA.debugLineNum = 2949129;BA.debugLine="Tw.close";
_tw.Close();
RDebugUtils.currentLine=2949131;
 //BA.debugLineNum = 2949131;BA.debugLine="End Sub";
return "";
}
public static String  _geturl(anywheresoftware.b4a.BA _ba,String _param1,String _param2) throws Exception{
RDebugUtils.currentModule="allgfnkt";
if (Debug.shouldDelegate(null, "geturl", false))
	 {return ((String) Debug.delegate(null, "geturl", new Object[] {_ba,_param1,_param2}));}
String _apipath = "";
RDebugUtils.currentLine=3014656;
 //BA.debugLineNum = 3014656;BA.debugLine="Public Sub GetURL(param1 As String, param2 As Stri";
RDebugUtils.currentLine=3014657;
 //BA.debugLineNum = 3014657;BA.debugLine="Dim apipath As String=\"\"";
_apipath = "";
RDebugUtils.currentLine=3014658;
 //BA.debugLineNum = 3014658;BA.debugLine="Select Case Jobname";
switch (BA.switchObjectToInt(_jobname,"GetPat","GetPatName")) {
case 0: {
RDebugUtils.currentLine=3014660;
 //BA.debugLineNum = 3014660;BA.debugLine="apipath=\"/DPMService/api/Service_View_Pat\"";
_apipath = "/DPMService/api/Service_View_Pat";
 break; }
case 1: {
RDebugUtils.currentLine=3014663;
 //BA.debugLineNum = 3014663;BA.debugLine="apipath=\"/DPMService/api/Service_View_Pat/searc";
_apipath = "/DPMService/api/Service_View_Pat/search";
 break; }
}
;
RDebugUtils.currentLine=3014665;
 //BA.debugLineNum = 3014665;BA.debugLine="If param1<>\"\" Then apipath=apipath&\"/\"&param1";
if ((_param1).equals("") == false) { 
_apipath = _apipath+"/"+_param1;};
RDebugUtils.currentLine=3014666;
 //BA.debugLineNum = 3014666;BA.debugLine="If param2<>\"\" Then apipath=apipath&\"/\"&param2";
if ((_param2).equals("") == false) { 
_apipath = _apipath+"/"+_param2;};
RDebugUtils.currentLine=3014668;
 //BA.debugLineNum = 3014668;BA.debugLine="Return sURL&apipath";
if (true) return _surl+_apipath;
RDebugUtils.currentLine=3014669;
 //BA.debugLineNum = 3014669;BA.debugLine="End Sub";
return "";
}
}