Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…erver

# Conflicts:
#	server/fhirserver.dproj
#	server/fhirserver.lpi
  • Loading branch information
grahamegrieve committed Feb 2, 2024
2 parents 6b1f825 + 49fdb2b commit 39f7346
Show file tree
Hide file tree
Showing 137 changed files with 4,971 additions and 2,023 deletions.
2,725 changes: 2,137 additions & 588 deletions exec/pack/lang.dat

Large diffs are not rendered by default.

1,552 changes: 1,552 additions & 0 deletions grafana/config-grafana-observability.json

Large diffs are not rendered by default.

6 changes: 4 additions & 2 deletions library/cda/cda_base.pas
Original file line number Diff line number Diff line change
Expand Up @@ -734,7 +734,7 @@ constructor Tv3PropertyDefinition.CreateBoolean(oOwner: Tv3Base; bIsStructural :
FCollectionState := rmpctNone;
FIsStructural := bIsStructural;
if bHasValue Then
FValueString := BoolToStr(bValue);
FValueString := BoolToStr(bValue, true).ToLower;
end;


Expand Down Expand Up @@ -1001,7 +1001,9 @@ function Tv3Base.BuildSet(var aSet; const aCodes: array of String): String;
While oIterator.More Do
Begin
If oIterator.Checked Then
oBuilder.Append(aCodes[oIterator.Index]+ crlf);
begin
oBuilder.AppendLine(aCodes[oIterator.Index]);
end;
oIterator.Next;
End;
Expand Down
5 changes: 4 additions & 1 deletion library/cda/cda_documents.pas
Original file line number Diff line number Diff line change
Expand Up @@ -747,7 +747,10 @@ function TCDADocument.RenderPatientIdentifiers: String;
ei := rt.patientRole.patient.asEntityIdentifier[j];
s.Append(', ');
if (ei.id.identifierName = '') and (ei.code <> nil) then
s.Append(ei.code.render+': ');
begin
s.Append(ei.code.render);
s.Append(': ');
end;
s.Append(ei.id.render);
end;
for j := 0 to rt.patientRole.id.Count - 1 do
Expand Down
6 changes: 3 additions & 3 deletions library/cda/cda_writer.pas
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ procedure TCDAWriter.WriteCDA(oXml: TXmlBuilder; oDoc: TcdaClinicalDocument);

Procedure TCDAWriter.WriteANYAttributes(Const sPath: string; oXml : TXmlBuilder; oDT : Tv3ANY);
Begin
Attribute(sPath, oXml, 'nullFLavor', writeNullFlavor(sPath, oDt.NullFlavor), true);
Attribute(sPath, oXml, 'nullFlavor', writeNullFlavor(sPath, oDt.NullFlavor), true);
// ignore updateMode and flavorId for now
End;

Expand All @@ -316,7 +316,7 @@ procedure TCDAWriter.WriteCDA(oXml: TXmlBuilder; oDoc: TcdaClinicalDocument);
WriteComments(oXml, oDT);
WriteANYAttributes(sPath, oXml, oDT);
if oDT.HasValue Then
Attribute(sPath, oXml, 'value', BoolToStr(oDT.value), true);
Attribute(sPath, oXml, 'value', BoolToStr(oDT.value, true).ToLower, true);
oDT.sourcelocation := oXml.Tag(sName);
End;

Expand Down Expand Up @@ -349,7 +349,7 @@ procedure TCDAWriter.WriteCDA(oXml: TXmlBuilder; oDoc: TcdaClinicalDocument);
Attribute(sPath, oXml, 'extension', oDT.extension, true);
Attribute(sPath, oXml, 'assigningAuthorityName', oDT.identifierName, true);
if oDT.hasDisplayable Then
Attribute(sPath, oXml, 'displayable', BoolToStr(oDT.displayable), true);
Attribute(sPath, oXml, 'displayable', BoolToStr(oDT.displayable, true).ToLower, true);
Attribute(sPath, oXml, 'scope', CODES_Tv3IdentifierScope[oDT.scope], true);
Attribute(sPath, oXml, 'reliability', CODES_Tv3IdentifierReliability[oDT.reliability], true);
oDT.sourcelocation := oXml.Tag(sName);
Expand Down
6 changes: 3 additions & 3 deletions library/fcomp/fcomp_graph.pas
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ interface
{$ELSE}
Windows, Messages, Vcl.Controls, Vcl.Graphics, Vcl.StdCtrls, Vcl.Forms, Vcl.ExtCtrls, Vcl.Clipbrd,
{$ENDIF}
fsl_base;
fsl_base, fsl_utilities;

const
tiny = 1.0e-20; { used to avoid divide by zero errors }
Expand Down Expand Up @@ -5574,7 +5574,7 @@ procedure TFGraph.SetPlotting(v : Boolean);

function TFGraph.SettingsText(code : boolean): String;
var
b : TStringBuilder;
b : TFslStringBuilder;
procedure p(name, value : String); overload;
begin
b.Append(' '+self.Name+'.'+name+' := '''+value+''';');
Expand Down Expand Up @@ -5830,7 +5830,7 @@ function TFGraph.SettingsText(code : boolean): String;
ps(name+'.Style', value.Style, CODES_TFontStyle);
end;
begin
b := TStringBuilder.Create;
b := TFslStringBuilder.Create;
try
p('Align', Ord(Align), CODES_TAlign);
p('BevelInner', ord(BevelInner), CODES_TBevelCut);
Expand Down
4 changes: 2 additions & 2 deletions library/fdb/fdb_manager.pas
Original file line number Diff line number Diff line change
Expand Up @@ -1933,12 +1933,12 @@ function TFDBColumn.Link: TFDBColumn;

function CommaText(list : TFslList<TFDBColumn>) : String;
var
s : TStringBuilder;
s : TFslStringBuilder;
b : boolean;
c : TFDBColumn;
begin
b := false;
s := TStringBuilder.Create;
s := TFslStringBuilder.Create;
try
for C in list do
begin
Expand Down
4 changes: 2 additions & 2 deletions library/fhir/fhir_cdshooks.pas
Original file line number Diff line number Diff line change
Expand Up @@ -512,15 +512,15 @@ function makeUrlSafe(url : String) : string;

function presentAsHtml(cards : TFslList<TCDSHookCard>; inprogress, errors : TStringList) : String;
var
b : TStringBuilder;
b : TFslStringBuilder;
card : TCDSHookCard;
md : TMarkdownProcessor;
s : String;
l : TCDSHookCardLink;
first : boolean;
cnt : boolean;
begin
b := TStringBuilder.Create;
b := TFslStringBuilder.Create;
try
b.Append(CARDS_HTML_HEAD);
cnt := false;
Expand Down
12 changes: 6 additions & 6 deletions library/fhir/fhir_codegen.pas
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ function TFHIRCodeGenerator.addVar(inScope: TArray<String>; varName: String): TA

function TFHIRCodeGenerator.enumify(code: String): String;
var
b : TStringBuilder;
b : TFslStringBuilder;
ch : char;
ws : boolean;
begin
Expand All @@ -211,7 +211,7 @@ function TFHIRCodeGenerator.enumify(code: String): String;
result := 'Plus'
else
begin
b := TStringBuilder.Create;
b := TFslStringBuilder.Create;
try
result := code.replace('-', ' ').replace('+', ' ');
ws := true;
Expand Down Expand Up @@ -306,11 +306,11 @@ destructor TFHIRCodeGeneratorJavaRI.Destroy;

function TFHIRCodeGeneratorJavaRI.generate: String;
var
b : TStringBuilder;
b : TFslStringBuilder;
s : String;
begin
processResource;
b := TStringBuilder.Create;
b := TFslStringBuilder.Create;
try
imports.Sort;
for s in imports do
Expand Down Expand Up @@ -590,12 +590,12 @@ destructor TFHIRCodeGeneratorPascal.Destroy;

function TFHIRCodeGeneratorPascal.generate: String;
var
b : TStringBuilder;
b : TFslStringBuilder;
first : boolean;
s, l, r : String;
begin
processResource;
b := TStringBuilder.Create;
b := TFslStringBuilder.Create;
try
b.Append('// uses ');
first := true;
Expand Down
4 changes: 2 additions & 2 deletions library/fhir/fhir_common.pas
Original file line number Diff line number Diff line change
Expand Up @@ -884,8 +884,8 @@ TFhirValueSetExpansionContainsW = class (TFHIRXVersionElementWrapper)

procedure addDesignation(lang, use, value : String); overload; virtual; abstract;
procedure addDesignation(lang : TIETFLang; use : TFHIRCodingW; value : TFHIRPrimitiveW; extensions : TFslList<TFHIRExtensionW>); overload; virtual; abstract;
procedure addProperty(code : String; value : TFHIRObject); virtual; abstract; overload;
procedure addProperty(code : String; value : TFhirCodeSystemConceptPropertyW); virtual; abstract; overload;
procedure addProperty(code : String; value : TFHIRObject); overload; virtual; abstract;
procedure addProperty(code : String; value : TFhirCodeSystemConceptPropertyW); overload; virtual; abstract;
procedure addContains(contained : TFhirValueSetExpansionContainsW); virtual; abstract;
procedure clearContains(); virtual; abstract;
function contains : TFslList<TFhirValueSetExpansionContainsW>; virtual; abstract;
Expand Down
8 changes: 4 additions & 4 deletions library/fhir/fhir_diff.pas
Original file line number Diff line number Diff line change
Expand Up @@ -626,10 +626,10 @@ procedure TDifferenceEngine.applyReplace(res : TFHIRObject; path: String; value:

function TDifferenceEngine.asHtml(differences: TDifferenceList): string;
var
b : TStringBuilder;
b : TFslStringBuilder;
diff : TDifference;
begin
b := TStringBuilder.Create;
b := TFslStringBuilder.Create;
try
b.append('<table>'#13#10);
b.Append('<tr>');
Expand Down Expand Up @@ -737,7 +737,7 @@ function TDifferenceEngine.asValue(value: TFHIRObject): string;
var
pl : TFHIRPropertyList;
c : TFHIRComposer;
b : TStringBuilder;
b : TFslStringBuilder;
begin
if value.isEnum then
result := FormatTextToXml(value.primitiveValue, xmlText)
Expand All @@ -756,7 +756,7 @@ function TDifferenceEngine.asValue(value: TFHIRObject): string;
end
else
begin
b := TStringBuilder.Create;
b := TFslStringBuilder.Create;
try
b.Append('{');
// an anonymous type. So what we do here is create the value, but the value
Expand Down
13 changes: 13 additions & 0 deletions library/fhir/fhir_factory.pas
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,9 @@ TFhirSystemCoding = class (TFHIRCodingW)
procedure setVersion(Value: String); override;
public
destructor Destroy; override;
function renderText : String; override;
function wrapExtension(extension : TFHIRObject) : TFHIRExtensionW; override;

end;

{ TFhirSystemCoding }
Expand All @@ -432,6 +435,11 @@ function TFhirSystemCoding.tuple: TFHIRSystemTuple;
result := Element as TFhirSystemTuple;
end;

function TFhirSystemCoding.wrapExtension(extension: TFHIRObject): TFHIRExtensionW;
begin
raise EFSLException.Create('Not Implemented Yet');
end;

function TFhirSystemCoding.getCode: String;
begin
if tuple.Fields['code'] = nil then
Expand Down Expand Up @@ -464,6 +472,11 @@ function TFhirSystemCoding.getVersion: String;
result := (tuple.Fields['version'] as TFHIRObject).ToString;
end;

function TFhirSystemCoding.renderText: String;
begin
result := systemUri+'#'+code;
end;

procedure TFhirSystemCoding.setCode(Value: String);
begin
raise EFSLException.create('TFhirSystemCoding.setCode is Not supported');
Expand Down
4 changes: 2 additions & 2 deletions library/fhir/fhir_graphql.pas
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ function TFHIRGraphQLEngine.filter(context : TFHIRResourceV; prop:TFHIRProperty;
result := obj.primitiveValue <> '';
end;
var
fp : TStringBuilder;
fp : TFslStringBuilder;
arg : TGraphQLArgument;
p : TFHIRProperty;
v : TFHIRObject;
Expand All @@ -367,7 +367,7 @@ function TFHIRGraphQLEngine.filter(context : TFHIRResourceV; prop:TFHIRProperty;
try
if values.Count > 0 then
begin
fp := TStringBuilder.Create;
fp := TFslStringBuilder.Create;
try
for arg in arguments do
begin
Expand Down
8 changes: 4 additions & 4 deletions library/fhir/fhir_pathengine.pas
Original file line number Diff line number Diff line change
Expand Up @@ -505,12 +505,12 @@ procedure TFHIRPathLexer.prevChar;

class function TFHIRPathLexer.processConstant(s: String) : String;
var
b : TStringBuilder;
b : TFslStringBuilder;
i : integer;
ch : char;
u : String;
begin
b := TStringBuilder.Create;
b := TFslStringBuilder.Create;
try
i := 2;
while i < length(s) do
Expand Down Expand Up @@ -1059,9 +1059,9 @@ function TFHIRPathLexer.isStringConstant : boolean;

function TFHIRPathLexer.takeDottedToken() : String;
var
b : TStringBuilder;
b : TFslStringBuilder;
begin
b := TStringBuilder.Create;
b := TFslStringBuilder.Create;
try
b.append(take());
while not done() and (FCurrent = '.') do
Expand Down
4 changes: 2 additions & 2 deletions library/fhir/fhir_xhtml.pas
Original file line number Diff line number Diff line change
Expand Up @@ -1301,11 +1301,11 @@ function FixRelativeReference(s : string; indent : integer) : String;
function normaliseWhitespace(s : String) : String;
var
w : boolean;
b : TStringBuilder;
b : TFslStringBuilder;
c : Char;
begin
w := false;
b := TStringBuilder.Create;
b := TFslStringBuilder.Create;
try
for c in s do
begin
Expand Down
4 changes: 2 additions & 2 deletions library/fhir2/fhir2_common.pas
Original file line number Diff line number Diff line change
Expand Up @@ -468,8 +468,8 @@ TFhirValueSetExpansionContains2 = class (TFhirValueSetExpansionContainsW)
function contains : TFslList<TFhirValueSetExpansionContainsW>; override;
procedure addDesignation(lang, use, value : String); override;
procedure addDesignation(lang : TIETFLang; use : TFHIRCodingW; value : TFHIRPrimitiveW; extensions : TFslList<TFHIRExtensionW>); override;
procedure addProperty(code : String; value : TFHIRObject); override; overload;
procedure addProperty(code : String; prop : TFhirCodeSystemConceptPropertyW); override; overload;
procedure addProperty(code : String; value : TFHIRObject); overload; override;
procedure addProperty(code : String; prop : TFhirCodeSystemConceptPropertyW); overload; override;
procedure addContains(contained : TFhirValueSetExpansionContainsW); override;
procedure clearContains(); override;
function properties : TFslList<TFhirCodeSystemConceptPropertyW>; override;
Expand Down
Loading

0 comments on commit 39f7346

Please sign in to comment.