Skip to content

Commit

Permalink
fix comple and improve log message
Browse files Browse the repository at this point in the history
  • Loading branch information
Grahame Grieve committed Nov 18, 2023
1 parent ab922a4 commit d6497c4
Show file tree
Hide file tree
Showing 25 changed files with 660 additions and 114 deletions.
4 changes: 2 additions & 2 deletions library/fhir4/fhir4_ips.pas
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ function TIPSGenerator.makePatient: TFhirPatient;
x : TFhirXHtmlNode;
ext : TFHIRExtension;
l : TFhirPatientCommunication;
sg, cg, dg, tg, sp, cdp, dp, tp, sv, cdv, dv, tv : String;
s, sg, cg, dg, tg, sp, cdp, dp, tp, sv, cdv, dv, tv : String;
begin
if (params.has('gender')) then
begin
Expand Down Expand Up @@ -488,7 +488,7 @@ function TIPSGenerator.makePatient: TFhirPatient;
l.language.text := params['language'];
l.preferred := true;
if ((s = 'en') or (s = 'english')) then
if (params.has('english') then
if (params.has('english')) then
begin
l := result.communicationList.Append;
l.language := TFHIRCodeableConcept.create;
Expand Down
24 changes: 22 additions & 2 deletions library/fhir4/fhir4_utilities.pas
Original file line number Diff line number Diff line change
Expand Up @@ -4107,16 +4107,29 @@ function TFhirValueSetHelper.context: string;
result := result + gen(useContextList[i]);
end;

function tail(url : String) : String;
begin
if url.contains('/') then
result := url.subString(url.lastIndexOf('/')+1)
else if url.contains(':') then
result := url.subString(url.lastIndexOf(':')+1)
else
result := url;
end;

function TFhirValueSetHelper.source: string;
var
ts : TStringList;
vs : TFhirCanonical;
comp : TFhirValueSetComposeInclude;
begin
ts := TStringList.Create;
try
ts.sorted := true;
ts.duplicates := dupIgnore;

if (compose <> nil) then
begin
for comp in compose.includeList do
begin
if comp.system <> '' then
Expand All @@ -4125,9 +4138,16 @@ function TFhirValueSetHelper.source: string;
begin
ts.add(csName(comp.system));
end;
end;
end
else
for vs in comp.valueSetList do
ts.add('vs:'+tail(vs.value));
end;
result := ts.commaText;
end;
if (ts.count = 0) then
result := 'unknown source'
else
result := ts.commaText;
finally
ts.free;
end;
Expand Down
2 changes: 1 addition & 1 deletion server/database.pas
Original file line number Diff line number Diff line change
Expand Up @@ -3363,7 +3363,7 @@ function TFHIRNativeOperationEngine.scanId(request : TFHIRRequest; entry : TFHIR
else if entry.requestUrl <> '' then
id.Name := fullResourceUri(request.baseUrl, entry.requestUrl)
else
id.Name := '??';
id.Name := '??id';
id.outcomeVersion := 1;

// figure out what kind of operation is involved here
Expand Down
4 changes: 2 additions & 2 deletions server/endpoint_packages.pas
Original file line number Diff line number Diff line change
Expand Up @@ -661,7 +661,7 @@ function TFHIRPackageWebServer.interpretVersion(v: String): String;
else if (v.StartsWith('1')) then
result := 'R3'
else
result := '??'
result := '??V'
end;
var
ts : TStringList;
Expand Down Expand Up @@ -815,7 +815,7 @@ function codeForKind(kind : integer): String;
fpkGroup : result := 'Group';
fpkExamples : result := 'Examples';
else
result := '?? ('+inttostr(kind)+')';
result := '??kind ('+inttostr(kind)+')';
end;
end;

Expand Down
4 changes: 2 additions & 2 deletions server/endpoint_storage.pas
Original file line number Diff line number Diff line change
Expand Up @@ -1199,7 +1199,7 @@ function TStorageWebEndpoint.HandleRequest(AContext: TIdContext; request: TIdHTT
Begin
// tt.track('req');
start := GetTickCount64;
result := '??';
result := '??eps';
noErrCode := false;
mode := opmRestful;
cache := false;
Expand Down Expand Up @@ -2465,7 +2465,7 @@ function TStorageWebEndpoint.getReferencesByType(t: String): String;
// else if entry.resource is TFhirOrganization then
// b.Append(TFhirOrganization(entry.resource).name)
// else
b.Append('??');
b.Append('??hn');
b.Append(' (');
b.Append(entry.resource.fhirType);
b.Append('/');
Expand Down
2 changes: 1 addition & 1 deletion server/endpoint_xig.pas
Original file line number Diff line number Diff line change
Expand Up @@ -640,7 +640,7 @@ procedure TXIGServerEndPoint.downloadAndReload;
function TXIGServerEndPoint.dateBuilt: String;
begin
if (FXIGServer = nil) or (FXIGServer.FContext = nil) then
result := '???'
result := '???xig'
else
result := FXIGServer.FContext.FDate;
end;
Expand Down
5 changes: 4 additions & 1 deletion server/fhirserver.lpi
Original file line number Diff line number Diff line change
Expand Up @@ -810,7 +810,7 @@
</Other>
</CompilerOptions>
<Debugging>
<Exceptions Count="49">
<Exceptions Count="50">
<Item1>
<Name Value="EAbort"/>
</Item1>
Expand Down Expand Up @@ -978,6 +978,9 @@
<Item49>
<Name Value="ESemVerException"/>
</Item49>
<Item50>
<Name Value="EPackageCrawlerException"/>
</Item50>
</Exceptions>
</Debugging>
</CONFIG>
2 changes: 1 addition & 1 deletion server/operations.pas
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ function TFhirVersionsOperation.Execute(context: TOperationContext; manager: TFH
var
p : TFhirParametersW;
begin
result := '??';
result := '??op';
try
p := FFactory.makeParameters;
try
Expand Down
2 changes: 1 addition & 1 deletion server/operations_r2.pas
Original file line number Diff line number Diff line change
Expand Up @@ -772,7 +772,7 @@ function TFhirGenerateQAOperation.CreateDefinition(base : String): TFHIROperatio

function TFhirGenerateQAOperation.Execute(context : TOperationContext; manager: TFHIROperationEngine; request: TFHIRRequest; response: TFHIRResponse; tt : TTimeTracker) : String;
begin
result := '??';
result := '??qa';
end;

{ TFhirJWTOperation }
Expand Down
40 changes: 20 additions & 20 deletions server/operations_r3.pas
Original file line number Diff line number Diff line change
Expand Up @@ -840,7 +840,7 @@ function TFhirGenerateQAOperation.CreateDefinition(base : String): TFHIROperatio

function TFhirGenerateQAOperation.Execute(context : TOperationContext; manager: TFHIROperationEngine; request: TFHIRRequest; response: TFHIRResponse; tt : TTimeTracker) : String;
begin
result := '??';
result := '??qa';
end;

{ TFhirJWTOperation }
Expand Down Expand Up @@ -881,7 +881,7 @@ function TFhirGenerateJWTOperation.Execute(context : TOperationContext; manager:
pIn : TFhirParameters;
pOut : TFhirParameters;
begin
result := '??';
result := '??jwt';
try
pIn := makeParamsV(request);
try
Expand Down Expand Up @@ -966,7 +966,7 @@ function TFhirGenerateCodeOperation.Execute(context : TOperationContext; manager
oo : TFHIROperationOutcome;
issue : TFhirOperationOutcomeIssue;
begin
result := '??';
result := '??gen';
try
manager.NotFound(request, response);
if native(manager).check(response, manager.opAllowed(request.ResourceName, request.CommandType), 400, manager.langList, StringFormat(GetFhirMessage('MSG_OP_NOT_ALLOWED', manager.langList), [CODES_TFHIRCommandType[request.CommandType], request.ResourceName]), itForbidden) then
Expand Down Expand Up @@ -1048,7 +1048,7 @@ function TFhirHandleQAPostOperation.CreateDefinition(base : String): TFHIROperat

function TFhirHandleQAPostOperation.Execute(context : TOperationContext; manager: TFHIROperationEngine; request: TFHIRRequest; response: TFHIRResponse; tt : TTimeTracker) : String;
begin
result := '??';
result := '??qap';
end;

function TFhirHandleQAPostOperation.isWrite: boolean;
Expand Down Expand Up @@ -1090,7 +1090,7 @@ function TFhirQuestionnaireGenerationOperation.Execute(context : TOperationConte
needSecure : boolean;
ctxt : TFHIRValidatorContext;
begin
result := '??';
result := '??qgen';
try
manager.NotFound(request, response);
if manager.check(response, request.Session.canRead(request.ResourceName) and manager.opAllowed(request.ResourceName, request.CommandType), 400, request.langList, StringFormat(GetFhirMessage('MSG_OP_NOT_ALLOWED', request.langList), [CODES_TFHIRCommandType[request.CommandType], request.ResourceName]), itForbidden) then
Expand Down Expand Up @@ -1251,7 +1251,7 @@ function TFhirValidationOperation.Execute(context : TOperationContext; manager:
result := request.Parameters[name];
end;
begin
result := '??';
result := '??val';
profileId := '';
profile := nil;
try
Expand Down Expand Up @@ -1361,7 +1361,7 @@ function TFhirEverythingOperation.Execute(context : TOperationContext; manager:
conn : TFDBConnection;
patIds : TPatientIdTracker;
begin
result := '??';
result := '??pe';
patIds := TPatientIdTracker.Create;
try
try
Expand Down Expand Up @@ -1489,7 +1489,7 @@ function TFhirProcessClaimOperation.Execute(context : TOperationContext; manager
resp : TFhirClaimResponse;
needSecure : boolean;
begin
result := '??';
result := '??claim';
claim := nil;
try
manager.NotFound(request, response);
Expand Down Expand Up @@ -1586,7 +1586,7 @@ function TFhirGenerateSnapshotOperation.Execute(context : TOperationContext; man
utils : TProfileUtilities;
op : TFHIROperationOutcome;
begin
result := '??';
result := '??sgen';
try
manager.NotFound(request, response);
if manager.check(response, manager.opAllowed(request.ResourceName, request.CommandType), 400, manager.langList, StringFormat(GetFhirMessage('MSG_OP_NOT_ALLOWED', manager.langList), [CODES_TFHIRCommandType[request.CommandType], request.ResourceName]), itForbidden) then
Expand Down Expand Up @@ -1702,7 +1702,7 @@ function TFhirGenerateTemplateOperation.Execute(context : TOperationContext; man
narr : TFHIRNarrativeGenerator;
needSecure : boolean;
begin
result := '??';
result := '??tgen';
try
manager.NotFound(request, response);
if manager.check(response, request.Session.canRead(request.ResourceName) and manager.opAllowed(request.ResourceName, request.CommandType), 400, request.langList, StringFormat(GetFhirMessage('MSG_OP_NOT_ALLOWED', request.langList), [CODES_TFHIRCommandType[request.CommandType], request.ResourceName]), itForbidden) then
Expand Down Expand Up @@ -1800,7 +1800,7 @@ function TFhirGenerateNarrativeOperation.Execute(context : TOperationContext; ma
narr : TFHIRNarrativeGenerator;
r : TFHIRResourceV;
begin
result := '??';
result := '??ngen';
try
r := request.Resource;
if (r = nil) then
Expand Down Expand Up @@ -1862,7 +1862,7 @@ function TFhirSuggestKeyWordsOperation.CreateDefinition(base: String): TFHIROper

function TFhirSuggestKeyWordsOperation.Execute(context : TOperationContext; manager: TFHIROperationEngine; request: TFHIRRequest; response: TFHIRResponse; tt : TTimeTracker) : String;
begin
result := '??';
result := '??key';
raise EFHIRException.CreateLang('NOT_DONE_YET', request.langList);
end;

Expand Down Expand Up @@ -1901,7 +1901,7 @@ function TFhirGetMetaDataOperation.Execute(context : TOperationContext; manager:
uri : TFhirUri;
params : TFhirParameters;
begin
result := '??';
result := '??mget';
try
ok := true;
if request.ResourceName = '' then
Expand Down Expand Up @@ -2050,7 +2050,7 @@ function TFhirAddMetaDataOperation.Execute(context : TOperationContext; manager:
mw : TFHIRMetaW;
p : TFHIRResource;
begin
result := '??';
result := '??madd';
meta := nil;

try
Expand Down Expand Up @@ -2217,7 +2217,7 @@ function TFhirDeleteMetaDataOperation.Execute(context : TOperationContext; manag
mw : TFHIRMetaW;
p : TFhirResource;
begin
result := '??';
result := '??mdel';
meta := nil;
try
ok := true;
Expand Down Expand Up @@ -2387,7 +2387,7 @@ function TFhirDiffOperation.Execute(context : TOperationContext; manager: TFHIRO
// meta : TFHIRMetaW;
// c : TFhirCoding;
begin
result := '??';
result := '??diff';
try
ok := true;
if not manager.check(response, request.canRead(request.ResourceName) and manager.opAllowed(request.ResourceName, fcmdRead), 400, request.langList, StringFormat(GetFhirMessage('MSG_OP_NOT_ALLOWED', request.langList), [CODES_TFHIRCommandType[request.CommandType], request.ResourceName]), itForbidden) then
Expand Down Expand Up @@ -2468,7 +2468,7 @@ function TFhirConvertOperation.CreateDefinition(base: String): TFHIROperationDef

function TFhirConvertOperation.Execute(context : TOperationContext; manager: TFHIROperationEngine; request: TFHIRRequest; response: TFHIRResponse; tt : TTimeTracker) : String;
begin
result := '??';
result := '??cnv';
try
response.Resource := request.Resource.link;
response.HTTPCode := 200;
Expand Down Expand Up @@ -2552,7 +2552,7 @@ function TFhirObservationStatsOperation.Execute(context : TOperationContext; man
list : TFslList<TFHIRResourceV>;
res : TFHIRResourceV;
begin
result := '??';
result := '??obs';
try
manager.NotFound(request, response);
req := TFHIRStatsOpRequest.Create();
Expand Down Expand Up @@ -2670,7 +2670,7 @@ function TFhirObservationLastNOperation.Execute(context : TOperationContext; man
prsrFmt : TFhirFormat;
patIds : TPatientIdTracker;
begin
result := '??';
result := '??lastn';
patIds := TPatientIdTracker.Create;
try
conn := native(manager).Connection;
Expand Down Expand Up @@ -3066,7 +3066,7 @@ function TFhirGenerateDocumentOperation.Execute(context : TOperationContext; man
needSecure : boolean;
patIds : TPatientIdTracker;
begin
result := '??';
result := '??dgen';
patIds := TPatientIdTracker.Create;
try
try
Expand Down
Loading

0 comments on commit d6497c4

Please sign in to comment.