Skip to content

Commit

Permalink
Merge pull request #60 from practicefusion/v1.2.1
Browse files Browse the repository at this point in the history
V1.2.1
  • Loading branch information
JonathanMalek authored Apr 1, 2023
2 parents c39a782 + bf230b6 commit a693894
Show file tree
Hide file tree
Showing 31 changed files with 2,260 additions and 2,005 deletions.
20 changes: 0 additions & 20 deletions .whitesource

This file was deleted.

2 changes: 2 additions & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ The following versions are supported with security updates.

| Version | Supported |
| ------- | ------------------ |
| 1.2.x | :white_check_mark: |
| 1.1.x | :white_check_mark: |
| 1.0.x | :white_check_mark: |
| < 1.0 | :x: |

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,5 +66,11 @@ public enum AdditionalInstructionEnum
/// </summary>
[ParseableEnum("on an empty stomach", "on an empty stomach")]
EmptyStomach,

/// <summary>
/// do not swallow
/// </summary>
[ParseableEnum("do not swallow", "do not swallow")]
DoNotSwallow,
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,16 @@ public enum DoseDeliveryMethodEnum
/// </summary>
[ParseableEnum("apply", "apply")] Apply,

/// <summary>
/// Chew
/// </summary>
[ParseableEnum("chew", "chew")] Chew,

/// <summary>
/// Chew and Swallow
/// </summary>
[ParseableEnum("chew and swallow", "chew and swallow")] ChewAndSwallow,

/// <summary>
/// Dissolve
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,12 @@ public enum FormEnum
[ParseableEnum("patch", "patches")]
Patch,

/// <summary>
/// Piece
/// </summary>
[ParseableEnum("piece", "pieces")]
Piece,

/// <summary>
/// Pill
/// </summary>
Expand Down
2,151 changes: 1,085 additions & 1,066 deletions src/Core/PracticeFusion.MmeCalculator.Core/Parsers/Generated/DefaultLexer.cs

Large diffs are not rendered by default.

1,894 changes: 1,030 additions & 864 deletions src/Core/PracticeFusion.MmeCalculator.Core/Parsers/Generated/DefaultParser.cs

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// ANTLR Version: 4.11.1
// ANTLR Version: 4.12.0
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

// Generated from /Users/jonathanmalek/src/mmecalculator/src/Grammar/DefaultParser.g4 by ANTLR 4.11.1
// Generated from /Users/jmalek/src/mmecalculator/src/Grammar/DefaultParser.g4 by ANTLR 4.12.0

// Unreachable code detected
#pragma warning disable 0162
Expand All @@ -32,7 +32,7 @@ namespace PracticeFusion.MmeCalculator.Core.Parsers.Generated {
/// which can be extended to create a listener which only needs to handle a subset
/// of the available methods.
/// </summary>
[System.CodeDom.Compiler.GeneratedCode("ANTLR", "4.11.1")]
[System.CodeDom.Compiler.GeneratedCode("ANTLR", "4.12.0")]
[System.Diagnostics.DebuggerNonUserCode]
[System.CLSCompliant(false)]
public partial class DefaultParserBaseListener : IDefaultParserListener {
Expand Down Expand Up @@ -553,6 +553,18 @@ public virtual void EnterWithLiquid([NotNull] DefaultParser.WithLiquidContext co
/// <param name="context">The parse tree.</param>
public virtual void ExitWithLiquid([NotNull] DefaultParser.WithLiquidContext context) { }
/// <summary>
/// Enter a parse tree produced by <see cref="DefaultParser.doNotSwallow"/>.
/// <para>The default implementation does nothing.</para>
/// </summary>
/// <param name="context">The parse tree.</param>
public virtual void EnterDoNotSwallow([NotNull] DefaultParser.DoNotSwallowContext context) { }
/// <summary>
/// Exit a parse tree produced by <see cref="DefaultParser.doNotSwallow"/>.
/// <para>The default implementation does nothing.</para>
/// </summary>
/// <param name="context">The parse tree.</param>
public virtual void ExitDoNotSwallow([NotNull] DefaultParser.DoNotSwallowContext context) { }
/// <summary>
/// Enter a parse tree produced by <see cref="DefaultParser.indicationForUse"/>.
/// <para>The default implementation does nothing.</para>
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// ANTLR Version: 4.11.1
// ANTLR Version: 4.12.0
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

// Generated from /Users/jonathanmalek/src/mmecalculator/src/Grammar/DefaultParser.g4 by ANTLR 4.11.1
// Generated from /Users/jmalek/src/mmecalculator/src/Grammar/DefaultParser.g4 by ANTLR 4.12.0

// Unreachable code detected
#pragma warning disable 0162
Expand All @@ -31,7 +31,7 @@ namespace PracticeFusion.MmeCalculator.Core.Parsers.Generated {
/// of the available methods.
/// </summary>
/// <typeparam name="Result">The return type of the visit operation.</typeparam>
[System.CodeDom.Compiler.GeneratedCode("ANTLR", "4.11.1")]
[System.CodeDom.Compiler.GeneratedCode("ANTLR", "4.12.0")]
[System.Diagnostics.DebuggerNonUserCode]
[System.CLSCompliant(false)]
public partial class DefaultParserBaseVisitor<Result> : AbstractParseTreeVisitor<Result>, IDefaultParserVisitor<Result> {
Expand Down Expand Up @@ -466,6 +466,16 @@ public partial class DefaultParserBaseVisitor<Result> : AbstractParseTreeVisitor
/// <return>The visitor result.</return>
public virtual Result VisitWithLiquid([NotNull] DefaultParser.WithLiquidContext context) { return VisitChildren(context); }
/// <summary>
/// Visit a parse tree produced by <see cref="DefaultParser.doNotSwallow"/>.
/// <para>
/// The default implementation returns the result of calling <see cref="AbstractParseTreeVisitor{Result}.VisitChildren(IRuleNode)"/>
/// on <paramref name="context"/>.
/// </para>
/// </summary>
/// <param name="context">The parse tree.</param>
/// <return>The visitor result.</return>
public virtual Result VisitDoNotSwallow([NotNull] DefaultParser.DoNotSwallowContext context) { return VisitChildren(context); }
/// <summary>
/// Visit a parse tree produced by <see cref="DefaultParser.indicationForUse"/>.
/// <para>
/// The default implementation returns the result of calling <see cref="AbstractParseTreeVisitor{Result}.VisitChildren(IRuleNode)"/>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// ANTLR Version: 4.11.1
// ANTLR Version: 4.12.0
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

// Generated from /Users/jonathanmalek/src/mmecalculator/src/Grammar/DefaultParser.g4 by ANTLR 4.11.1
// Generated from /Users/jmalek/src/mmecalculator/src/Grammar/DefaultParser.g4 by ANTLR 4.12.0

// Unreachable code detected
#pragma warning disable 0162
Expand All @@ -28,7 +28,7 @@ namespace PracticeFusion.MmeCalculator.Core.Parsers.Generated {
/// This interface defines a complete listener for a parse tree produced by
/// <see cref="DefaultParser"/>.
/// </summary>
[System.CodeDom.Compiler.GeneratedCode("ANTLR", "4.11.1")]
[System.CodeDom.Compiler.GeneratedCode("ANTLR", "4.12.0")]
[System.CLSCompliant(false)]
public interface IDefaultParserListener : IParseTreeListener {
/// <summary>
Expand Down Expand Up @@ -462,6 +462,16 @@ public interface IDefaultParserListener : IParseTreeListener {
/// <param name="context">The parse tree.</param>
void ExitWithLiquid([NotNull] DefaultParser.WithLiquidContext context);
/// <summary>
/// Enter a parse tree produced by <see cref="DefaultParser.doNotSwallow"/>.
/// </summary>
/// <param name="context">The parse tree.</param>
void EnterDoNotSwallow([NotNull] DefaultParser.DoNotSwallowContext context);
/// <summary>
/// Exit a parse tree produced by <see cref="DefaultParser.doNotSwallow"/>.
/// </summary>
/// <param name="context">The parse tree.</param>
void ExitDoNotSwallow([NotNull] DefaultParser.DoNotSwallowContext context);
/// <summary>
/// Enter a parse tree produced by <see cref="DefaultParser.indicationForUse"/>.
/// </summary>
/// <param name="context">The parse tree.</param>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// ANTLR Version: 4.11.1
// ANTLR Version: 4.12.0
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

// Generated from /Users/jonathanmalek/src/mmecalculator/src/Grammar/DefaultParser.g4 by ANTLR 4.11.1
// Generated from /Users/jmalek/src/mmecalculator/src/Grammar/DefaultParser.g4 by ANTLR 4.12.0

// Unreachable code detected
#pragma warning disable 0162
Expand All @@ -29,7 +29,7 @@ namespace PracticeFusion.MmeCalculator.Core.Parsers.Generated {
/// by <see cref="DefaultParser"/>.
/// </summary>
/// <typeparam name="Result">The return type of the visit operation.</typeparam>
[System.CodeDom.Compiler.GeneratedCode("ANTLR", "4.11.1")]
[System.CodeDom.Compiler.GeneratedCode("ANTLR", "4.12.0")]
[System.CLSCompliant(false)]
public interface IDefaultParserVisitor<Result> : IParseTreeVisitor<Result> {
/// <summary>
Expand Down Expand Up @@ -291,6 +291,12 @@ public interface IDefaultParserVisitor<Result> : IParseTreeVisitor<Result> {
/// <return>The visitor result.</return>
Result VisitWithLiquid([NotNull] DefaultParser.WithLiquidContext context);
/// <summary>
/// Visit a parse tree produced by <see cref="DefaultParser.doNotSwallow"/>.
/// </summary>
/// <param name="context">The parse tree.</param>
/// <return>The visitor result.</return>
Result VisitDoNotSwallow([NotNull] DefaultParser.DoNotSwallowContext context);
/// <summary>
/// Visit a parse tree produced by <see cref="DefaultParser.indicationForUse"/>.
/// </summary>
/// <param name="context">The parse tree.</param>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@ public AdditionalInstruction VisitRoot(DefaultParser.AdditionalInstructionContex
result.ValueEnum = AdditionalInstructionEnum.AsDirected;
}

if(context.doNotSwallow() != null)
{
result.ValueEnum = AdditionalInstructionEnum.DoNotSwallow;
}

result.Description = context.GetOriginalTextWithSpacing();
return result;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ public DoseDeliveryMethod VisitRoot(DefaultParser.DoseDeliveryMethodContext cont
{
DefaultLexer.ADMINISTER => DoseDeliveryMethodEnum.Administer,
DefaultLexer.APPLY => DoseDeliveryMethodEnum.Apply,
DefaultLexer.CHEW => context.SWALLOW() != null ?
DoseDeliveryMethodEnum.ChewAndSwallow : DoseDeliveryMethodEnum.Chew,
DefaultLexer.DISSOLVE => DoseDeliveryMethodEnum.Dissolve,
DefaultLexer.GIVE => DoseDeliveryMethodEnum.Give,
DefaultLexer.INFUSE => DoseDeliveryMethodEnum.Infuse,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ private static FormEnum VisitFormEnum(IToken token)
DefaultLexer.NASAL => FormEnum.Nasal,
DefaultLexer.ORAL => FormEnum.Oral,
DefaultLexer.PATCH => FormEnum.Patch,
DefaultLexer.PIECE => FormEnum.Piece,
DefaultLexer.PILL => FormEnum.Pill,
DefaultLexer.PUFF => FormEnum.Puff,
DefaultLexer.RECTAL => FormEnum.Rectal,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,13 @@
<ItemGroup>
<!-- for source link, and versioning -->
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="All" />
<PackageReference Include="MinVer" Version="4.2.0" PrivateAssets="All" />
<PackageReference Include="MinVer" Version="4.3.0" PrivateAssets="All" />

<PackageReference Include="Antlr4.Runtime.Standard" Version="4.11.1" />
<PackageReference Include="Antlr4.Runtime.Standard" Version="4.12.0" />
<PackageReference Include="Microsoft.Extensions.Caching.Abstractions" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="7.0.0" />
<PackageReference Include="System.Text.Json" Version="7.0.0" />
<PackageReference Include="System.Text.Json" Version="7.0.2" />
<None Include="../../../README.md" Pack="true" PackagePath="." />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
<ItemGroup>
<!-- for source link, and versioning -->
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="All" />
<PackageReference Include="MinVer" Version="4.2.0" PrivateAssets="All" />
<PackageReference Include="MinVer" Version="4.3.0" PrivateAssets="All" />

<ProjectReference Include="..\PracticeFusion.MmeCalculator.Core\PracticeFusion.MmeCalculator.Core.csproj" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@
<ItemGroup>
<!-- for source link, and versioning -->
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="All" />
<PackageReference Include="MinVer" Version="4.2.0" PrivateAssets="All" />
<PackageReference Include="MinVer" Version="4.3.0" PrivateAssets="All" />

<PackageReference Include="RestSharp" Version="108.0.3" />
<PackageReference Include="System.Text.Json" Version="7.0.0" />
<PackageReference Include="System.Text.Json" Version="7.0.2" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/Grammar/.vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
"language": "CSharp",
"listeners": true,
"visitors": true,
"alternativeJar": "antlr-4.11.1-complete.jar"
"alternativeJar": "antlr-4.12.0-complete.jar"
}
}
6 changes: 6 additions & 0 deletions src/Grammar/DefaultLexer.g4
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ BREATH: B R E A T H;
BEFORE: B E F O R E;
BY: B Y;
CHANGE: C H A N G E;
CHEW: C H E W;
COUGH: C O U G H;
DINNER: D I N N E R;
DIRECTED: D I R E C T E D;
Expand Down Expand Up @@ -141,6 +142,7 @@ SOB: S O B;
STOMACH: S T O M A C H;
SUCK: S U C K;
SUPPLY: S U P P L Y;
SWALLOW: S W A L L O W;
TAKE: T A K E;
THE: T H E;
THEN: T H E N;
Expand Down Expand Up @@ -189,6 +191,7 @@ INJECTION: I N J E C T I O N S?;
LOLLIPOP: L O L L I P O P S?;
LOZENGE: L O Z E N G E S?;
PATCH: P A T C H (E S)?;
PIECE: P I E C E S?;
PILL: P I L L S?;
PUFF: P U F F S?;
SOLUTION: S O L (N | U T I O N);
Expand Down Expand Up @@ -322,6 +325,9 @@ TARTRATE: T A R T R A T E;
PHOSPHATE: P H O S P H A T E;
POLISTIREX: P O L I S T I R E X;

// additional instructions
DONOTSWALLOW: D O ' ' N O T ' ' S W A L L O W;

// ignore whitespace
WS: [ \r\t\n,]+ -> skip;

Expand Down
7 changes: 6 additions & 1 deletion src/Grammar/DefaultParser.g4
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ dosageSeparator: AND? THEN | OR;
doseDeliveryMethod:
ADMINISTER
| APPLY
| CHEW
| CHEW AND SWALLOW
| DISSOLVE
| GIVE
| INFUSE
Expand Down Expand Up @@ -71,6 +73,7 @@ form:
| LOLLIPOP
| LOZENGE
| PATCH
| PIECE
| PILL
| PUFF
| SOLUTION
Expand Down Expand Up @@ -233,7 +236,7 @@ durationUnbounded: THEREAFTER;

//////////////////////////////////////////////////////////////////////////
// Additional Instructions
additionalInstruction: withFood | withLiquid | asDirected | emptyStomach;
additionalInstruction: withFood | withLiquid | asDirected | emptyStomach | doNotSwallow;

emptyStomach: ON A_AN? EMPTY_TOKEN STOMACH;

Expand All @@ -245,6 +248,8 @@ withFood: (BEFORE | AFTER | WITH) (MEAL | FOOD | EATING)

withLiquid: WITH (PLENTY OF)? (WATER | MILK | LIQUID);

doNotSwallow: DONOTSWALLOW;

//////////////////////////////////////////////////////////////////////////
// Indication for Use
indicationForUse:
Expand Down
Binary file not shown.
4 changes: 2 additions & 2 deletions src/Samples/PracticeFusion.MmeCalculator.WebDemo/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS base
FROM mcr.microsoft.com/dotnet/aspnet:7.0 AS base
WORKDIR /app
EXPOSE 80

FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build
FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build
WORKDIR /src
COPY ["Samples/PracticeFusion.MmeCalculator.WebDemo/PracticeFusion.MmeCalculator.WebDemo.csproj", "Samples/PracticeFusion.MmeCalculator.WebDemo/"]
RUN dotnet restore "Samples/PracticeFusion.MmeCalculator.WebDemo/PracticeFusion.MmeCalculator.WebDemo.csproj"
Expand Down
Loading

0 comments on commit a693894

Please sign in to comment.