Fix merge
This commit is contained in:
parent
c52d5a71b4
commit
66ecd24cad
|
@ -10,33 +10,22 @@ import org.hl7.fhir.exceptions.FHIRException;
|
||||||
import org.hl7.fhir.r4.context.SimpleWorkerContext;
|
import org.hl7.fhir.r4.context.SimpleWorkerContext;
|
||||||
import org.hl7.fhir.r4.formats.IParser.OutputStyle;
|
import org.hl7.fhir.r4.formats.IParser.OutputStyle;
|
||||||
import org.hl7.fhir.r4.formats.JsonParser;
|
import org.hl7.fhir.r4.formats.JsonParser;
|
||||||
<<<<<<< HEAD
|
|
||||||
import org.hl7.fhir.r4.formats.XmlParser;
|
|
||||||
=======
|
|
||||||
>>>>>>> master
|
|
||||||
import org.hl7.fhir.r4.model.Base;
|
import org.hl7.fhir.r4.model.Base;
|
||||||
import org.hl7.fhir.r4.model.BooleanType;
|
import org.hl7.fhir.r4.model.BooleanType;
|
||||||
import org.hl7.fhir.r4.model.Bundle;
|
import org.hl7.fhir.r4.model.Bundle;
|
||||||
import org.hl7.fhir.r4.model.Bundle.BundleEntryComponent;
|
import org.hl7.fhir.r4.model.Bundle.BundleEntryComponent;
|
||||||
import org.hl7.fhir.r4.model.CapabilityStatement;
|
import org.hl7.fhir.r4.model.CapabilityStatement;
|
||||||
<<<<<<< HEAD
|
|
||||||
import org.hl7.fhir.r4.model.CodeSystem;
|
import org.hl7.fhir.r4.model.CodeSystem;
|
||||||
=======
|
|
||||||
>>>>>>> master
|
|
||||||
import org.hl7.fhir.r4.model.CodeType;
|
import org.hl7.fhir.r4.model.CodeType;
|
||||||
import org.hl7.fhir.r4.model.CodeableConcept;
|
import org.hl7.fhir.r4.model.CodeableConcept;
|
||||||
import org.hl7.fhir.r4.model.Coding;
|
import org.hl7.fhir.r4.model.Coding;
|
||||||
import org.hl7.fhir.r4.model.Condition;
|
import org.hl7.fhir.r4.model.Condition;
|
||||||
<<<<<<< HEAD
|
|
||||||
import org.hl7.fhir.r4.model.DateType;
|
import org.hl7.fhir.r4.model.DateType;
|
||||||
import org.hl7.fhir.r4.model.HumanName;
|
import org.hl7.fhir.r4.model.HumanName;
|
||||||
import org.hl7.fhir.r4.model.Immunization;
|
import org.hl7.fhir.r4.model.Immunization;
|
||||||
import org.hl7.fhir.r4.model.Parameters;
|
import org.hl7.fhir.r4.model.Parameters;
|
||||||
import org.hl7.fhir.r4.model.Parameters.ParametersParameterComponent;
|
import org.hl7.fhir.r4.model.Parameters.ParametersParameterComponent;
|
||||||
=======
|
|
||||||
import org.hl7.fhir.r4.model.HumanName;
|
|
||||||
import org.hl7.fhir.r4.model.Immunization;
|
|
||||||
>>>>>>> master
|
|
||||||
import org.hl7.fhir.r4.model.Patient;
|
import org.hl7.fhir.r4.model.Patient;
|
||||||
import org.hl7.fhir.r4.model.Period;
|
import org.hl7.fhir.r4.model.Period;
|
||||||
import org.hl7.fhir.r4.model.Procedure;
|
import org.hl7.fhir.r4.model.Procedure;
|
||||||
|
@ -79,11 +68,8 @@ public class CmdLineApp {
|
||||||
finished = true;
|
finished = true;
|
||||||
} else if (p.length == 1 && p[0].equals("?")) {
|
} else if (p.length == 1 && p[0].equals("?")) {
|
||||||
genMenu();
|
genMenu();
|
||||||
<<<<<<< HEAD
|
|
||||||
} else if (p.length == 1 && p[0].equals("?tx")) {
|
} else if (p.length == 1 && p[0].equals("?tx")) {
|
||||||
genMenuTx();
|
genMenuTx();
|
||||||
=======
|
|
||||||
>>>>>>> master
|
|
||||||
} else if (p.length >= 1 && p[0].equals("c")) {
|
} else if (p.length >= 1 && p[0].equals("c")) {
|
||||||
if (p.length == 1) {
|
if (p.length == 1) {
|
||||||
connectToServer("http://hapi.fhir.org/baseR4");
|
connectToServer("http://hapi.fhir.org/baseR4");
|
||||||
|
@ -129,15 +115,10 @@ public class CmdLineApp {
|
||||||
select("Patient", p[1]);
|
select("Patient", p[1]);
|
||||||
} else if (p.length == 3 && p[0].equals("e")) {
|
} else if (p.length == 3 && p[0].equals("e")) {
|
||||||
edit(p[1], p[2]);
|
edit(p[1], p[2]);
|
||||||
<<<<<<< HEAD
|
|
||||||
} else if (p.length > 3 && p[0].equals("tx")) {
|
} else if (p.length > 3 && p[0].equals("tx")) {
|
||||||
tx(p);
|
tx(p);
|
||||||
} else {
|
} else {
|
||||||
tx(p);
|
tx(p);
|
||||||
=======
|
|
||||||
} else {
|
|
||||||
System.out.println("Command unknown or not understood: "+cmd);
|
|
||||||
>>>>>>> master
|
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
System.out.println("Error executing command "+p[0]+": "+e.getMessage());
|
System.out.println("Error executing command "+p[0]+": "+e.getMessage());
|
||||||
|
@ -147,7 +128,6 @@ public class CmdLineApp {
|
||||||
System.out.println("Finished!");
|
System.out.println("Finished!");
|
||||||
}
|
}
|
||||||
|
|
||||||
<<<<<<< HEAD
|
|
||||||
private boolean tx(String[] p) throws IOException {
|
private boolean tx(String[] p) throws IOException {
|
||||||
if (p[1].equals("l")) {
|
if (p[1].equals("l")) {
|
||||||
if (p.length == 4) {
|
if (p.length == 4) {
|
||||||
|
@ -190,9 +170,6 @@ public class CmdLineApp {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void getImmunizations() throws IOException {
|
private void getImmunizations() throws IOException {
|
||||||
=======
|
|
||||||
private void getImmunizations() {
|
|
||||||
>>>>>>> master
|
|
||||||
|
|
||||||
Bundle bnd = client.search("Immunization", "?patient="+currentId);
|
Bundle bnd = client.search("Immunization", "?patient="+currentId);
|
||||||
System.out.println(""+bnd.getTotal()+" Immunizations found. Printing "+bnd.getEntry().size());
|
System.out.println(""+bnd.getTotal()+" Immunizations found. Printing "+bnd.getEntry().size());
|
||||||
|
@ -203,11 +180,7 @@ public class CmdLineApp {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
<<<<<<< HEAD
|
|
||||||
private void getProcedures() throws IOException {
|
private void getProcedures() throws IOException {
|
||||||
=======
|
|
||||||
private void getProcedures() {
|
|
||||||
>>>>>>> master
|
|
||||||
|
|
||||||
Bundle bnd = client.search("Procedure", "?patient="+currentId);
|
Bundle bnd = client.search("Procedure", "?patient="+currentId);
|
||||||
System.out.println(""+bnd.getTotal()+" Procedures found. Printing "+bnd.getEntry().size());
|
System.out.println(""+bnd.getTotal()+" Procedures found. Printing "+bnd.getEntry().size());
|
||||||
|
@ -218,11 +191,7 @@ public class CmdLineApp {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
<<<<<<< HEAD
|
|
||||||
private void getConditions() throws IOException {
|
private void getConditions() throws IOException {
|
||||||
=======
|
|
||||||
private void getConditions() {
|
|
||||||
>>>>>>> master
|
|
||||||
|
|
||||||
Bundle bnd = client.search("Condition", "?patient="+currentId);
|
Bundle bnd = client.search("Condition", "?patient="+currentId);
|
||||||
System.out.println(""+bnd.getTotal()+" Conditions found. Printing "+bnd.getEntry().size());
|
System.out.println(""+bnd.getTotal()+" Conditions found. Printing "+bnd.getEntry().size());
|
||||||
|
@ -257,10 +226,7 @@ public class CmdLineApp {
|
||||||
case "boolean" : return new BooleanType(value);
|
case "boolean" : return new BooleanType(value);
|
||||||
case "code" : return new CodeType(value);
|
case "code" : return new CodeType(value);
|
||||||
case "string" : return new StringType(value);
|
case "string" : return new StringType(value);
|
||||||
<<<<<<< HEAD
|
|
||||||
case "date" : return new DateType(value);
|
case "date" : return new DateType(value);
|
||||||
=======
|
|
||||||
>>>>>>> master
|
|
||||||
}
|
}
|
||||||
throw new FHIRException("Unhandled type "+p.getTypeCode());
|
throw new FHIRException("Unhandled type "+p.getTypeCode());
|
||||||
}
|
}
|
||||||
|
@ -278,11 +244,7 @@ public class CmdLineApp {
|
||||||
System.out.println(new JsonParser().setOutputStyle(OutputStyle.PRETTY).composeString(currentResource));
|
System.out.println(new JsonParser().setOutputStyle(OutputStyle.PRETTY).composeString(currentResource));
|
||||||
}
|
}
|
||||||
|
|
||||||
<<<<<<< HEAD
|
|
||||||
private void select(String type, String id) throws IOException {
|
private void select(String type, String id) throws IOException {
|
||||||
=======
|
|
||||||
private void select(String type, String id) {
|
|
||||||
>>>>>>> master
|
|
||||||
if (type.equals("Patient")) {
|
if (type.equals("Patient")) {
|
||||||
currentResource = client.fetchResource(Patient.class, id);
|
currentResource = client.fetchResource(Patient.class, id);
|
||||||
} else if (type.equals("Immunization")) {
|
} else if (type.equals("Immunization")) {
|
||||||
|
@ -298,12 +260,8 @@ public class CmdLineApp {
|
||||||
System.out.println("Resource = "+currentId+" "+summary(currentResource));
|
System.out.println("Resource = "+currentId+" "+summary(currentResource));
|
||||||
}
|
}
|
||||||
|
|
||||||
<<<<<<< HEAD
|
|
||||||
private String summary(Resource r) throws IOException {
|
private String summary(Resource r) throws IOException {
|
||||||
// return new XmlParser().composeString(r);
|
// return new XmlParser().composeString(r);
|
||||||
=======
|
|
||||||
private String summary(Resource r) {
|
|
||||||
>>>>>>> master
|
|
||||||
if (r instanceof Patient) {
|
if (r instanceof Patient) {
|
||||||
Patient pat = (Patient) r;
|
Patient pat = (Patient) r;
|
||||||
return pat.getIdBase()+" "+pat.getGender()+" "+pat.getBirthDateElement().asStringValue()+" "+name(pat);
|
return pat.getIdBase()+" "+pat.getGender()+" "+pat.getBirthDateElement().asStringValue()+" "+name(pat);
|
||||||
|
@ -366,11 +324,7 @@ public class CmdLineApp {
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
<<<<<<< HEAD
|
|
||||||
private void search(String[] p) throws IOException {
|
private void search(String[] p) throws IOException {
|
||||||
=======
|
|
||||||
private void search(String[] p) {
|
|
||||||
>>>>>>> master
|
|
||||||
if (client == null) {
|
if (client == null) {
|
||||||
throw new FHIRException("Not connected to to a server");
|
throw new FHIRException("Not connected to to a server");
|
||||||
}
|
}
|
||||||
|
@ -378,11 +332,7 @@ public class CmdLineApp {
|
||||||
if (p.length > 2) {
|
if (p.length > 2) {
|
||||||
search = search +"&gender="+p[2];
|
search = search +"&gender="+p[2];
|
||||||
if (p.length > 3) {
|
if (p.length > 3) {
|
||||||
<<<<<<< HEAD
|
|
||||||
search = search +"&birthdate="+p[3];
|
search = search +"&birthdate="+p[3];
|
||||||
=======
|
|
||||||
search = search +"&dob="+p[3];
|
|
||||||
>>>>>>> master
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Bundle bnd = client.search("Patient", search);
|
Bundle bnd = client.search("Patient", search);
|
||||||
|
@ -418,7 +368,6 @@ public class CmdLineApp {
|
||||||
private void connectToServer(String url) throws URISyntaxException {
|
private void connectToServer(String url) throws URISyntaxException {
|
||||||
client = new FHIRToolingClient(url, "FHIR-Command-Line-App");
|
client = new FHIRToolingClient(url, "FHIR-Command-Line-App");
|
||||||
CapabilityStatement cs = client.getCapabilitiesStatementQuick();
|
CapabilityStatement cs = client.getCapabilitiesStatementQuick();
|
||||||
<<<<<<< HEAD
|
|
||||||
System.out.println("Connected to "+url+": "+cs.getSoftware().getName()+", version "+cs.getFhirVersion().toCode());
|
System.out.println("Connected to "+url+": "+cs.getSoftware().getName()+", version "+cs.getFhirVersion().toCode());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -431,11 +380,6 @@ public class CmdLineApp {
|
||||||
System.out.println(" x - exit");
|
System.out.println(" x - exit");
|
||||||
}
|
}
|
||||||
|
|
||||||
=======
|
|
||||||
System.out.println("Connected to "+url+": "+cs.getSoftware().getName()+".");
|
|
||||||
}
|
|
||||||
|
|
||||||
>>>>>>> master
|
|
||||||
private void genMenu() {
|
private void genMenu() {
|
||||||
System.out.println("Simple Client. Commands you can run:");
|
System.out.println("Simple Client. Commands you can run:");
|
||||||
System.out.println(" c {url} - connect to a server");
|
System.out.println(" c {url} - connect to a server");
|
||||||
|
|
Loading…
Reference in New Issue