You can add after the %Save() command something like this:

set sqlUpdateMoodRecord = "UPDATE MoopRecord SET TotalAmount = 
        CASE WHEN TotalAmount > ? THEN TotalAmount - ? WHEN TotalAmount < ? THEN ? -TotalAmount
            ELSE TotalAmount WHERE %ID = ?"
set statementUpdateMoodRecord = ##class(%SQL.Statement).%New()
set statusUpdateMoodRecord = statementUpdateMoodRecord.%Prepare(sqlUpdateMoodRecord)
if ($$$ISOK(statusUpdateMoodRecord)) {
    set resultSet = statementUpdateMoodRecord.%Execute(pRequest.TotalAmount, 
                        pRequest.TotalAmount, pRequest.TotalAmount, pRequest.TotalAmount,
                        tEntEpicMoopRecord.%ID)
}

Probably that code is not going to work...but the idea is to launch an UPDATE with a condition in the SET.

Well, Code function is validating if the code in source.Severity has a match in the target ValueSet and if it has then return the code. Maybe you can add a new line after each null validation of value var with something like these to get the description value:

^HS.XF.LookupTable("SDA3","vSTU3","HS.SDA3.CodeTableDetail.AllergyCategory","allergy-intolerance-category",value)

^HS.XF.LookupTable("SDA3","vR4","HS.SDA3.CodeTableDetail.Severity","reaction-event-severity|4.0.1",value)

And update the assign with something like this:

<assign value='^HS.XF.LookupTable("SDA3","vSTU3","HS.SDA3.CodeTableDetail.AllergyCategory","allergy-intolerance-category",value)' property='target.category' action='set'>

But not sure if it's correct to overwrite the codes of the resource with the description...try it and if you don't break anything keep it!

Jeffrey is totally right, you can't add multiple ranges in an OBX segment, the idea of that field is just to add the valid range for the observation, you can see that there is another field in that segment (OBX:12 - Efective date of Reference Range) in wich you can define the date when the range start to be valid.

Another option to the NTE segment is to repeat the OBX segment with the same value of the observation so many times as range values you have, informing the OBX:12 with a different date and the valid range for that date.

There is a DTL by default when you install the FHIR server or the FHIR adapter...in my case I've installed the adapter and the DTL is named:

HS.FHIR.DTL.vR4.SDA3.AllergyIntolerance.Allergy

This transformation is used to parse an object of type HS.FHIR.DTL.vR4.Model.Resource.AllergyIntolerance into a HS.SDA3.Allergy, you can use it as a reference for your transformation. 

Something like this example?
http://hl7.org/fhir/R4/allergyintolerance-fishallergy.json.html

{
  "resourceType": "AllergyIntolerance",
  "id": "fishallergy",
  "text": {
    "status": "additional",
    "div": "<div xmlns=\"http://www.w3.org/1999/xhtml\">\n      <p>allergy is to fresh fish. Tolerates canned fish</p>\n      <p>recordedDate:2015-08-06T00:00:00-06:00</p>\n      <p>substance:Fish - dietary (substance)</p>\n    </div>"
  },
  "identifier": [
    {
      "system": "http://acme.com/ids/patients/risks",
      "value": "49476535"
    }
  ],
  "clinicalStatus": {
    "coding": [
      {
        "system": "http://terminology.hl7.org/CodeSystem/allergyintolerance-clinical",
        "code": "active",
        "display": "Active"
      }
    ]
  },
  "verificationStatus": {
    "coding": [
      {
        "system": "http://terminology.hl7.org/CodeSystem/allergyintolerance-verification",
        "code": "confirmed",
        "display": "Confirmed"
      }
    ]
  },
  "category": [
    "food"
  ],
  "code": {
    "coding": [
      {
        "system": "http://snomed.info/sct",
        "code": "227037002",
        "display": "Fish - dietary (substance)"
      }
    ],
    "text": "Allergic to fresh fish. Tolerates canned fish"
  },
  "patient": {
    "reference": "Patient/example"
  },
  "recordedDate": "2015-08-06T15:37:31-06:00",
  "recorder": {
    "reference": "Practitioner/example"
  }
}