// Job ID: #6900354758652f6f2eda48df
using OI.Service.HangfireTask;
var packingFoilTask = Activate<PackingFoilTask>();
await packingFoilTask.ExecuteUpdateDrug(
"6840d2a408efed0f0c610cb4",
FromJson<Drug>("{\"DrugName\":\"ALLOPURINOL (APOTEX) 100mg TAB\",\"DrugCode\":\"ALLO22\",\"Austr\":\"269652\",\"Supplier\":\"APOTEX PTY LTD\",\"Type\":\"Tablet\",\"Color\":\"white to off-white\",\"Shape\":\"round\",\"Marking\":\"AL 100\",\"Warning\":\"with or soon after food.*May affect alertness and/or co-ordination. If affected, do not drive or operate machineryPDL Warn: Caution Strengths*Ask your Doctor or Pharmacist before using other medicines including over-the-counter or any health products\",\"Direction\":\"\",\"GenericCode\":\"ALP1\",\"GenericName\":\"ALLOPURINOL\",\"Presentation\":\"Used to treat gout or kidney stones, and to decrease levels of uric acid in people who are receiving cancer treatment.\",\"ImageId\":\"5f3a2f1aa0ba5d7c50797138\",\"ImageSmallSizeId\":\"68f599d55a506b941b5c9689\",\"ImageName\":\"269652-C01-01-BL600.jpg\",\"AltBrand\":\"PROGOUT, ZYLOPRIM, ALLORIN, ZYGOUT 100, ALLOPURINOL (SBPA), ALLOPURINOL (SANDOZ), ALLOPURINOL-BC, ZYLOPRIM, ALLOPURINOL (CHEM-MART), ALLOPURINOL (HEALTHSENSE), ALLOPURINOL (TW), ALLOPURINOL (GENRX), ALLOSIG, ALLOPURINOL (SANDOZ), ALLOPURINOL (APO), PROGOUT, ALLOPURINOL (APOTEX), ALLOPURINOL (NOUMED), ALLOPURINOL (WGR), PROGOUT (VIATRIS)\",\"DoNotCrush\":false,\"TradeName\":\"ALLOPURINOL (APOTEX)\",\"Formulation\":\"TAB\",\"Strength\":\"100mg\",\"Schedule\":\"4\",\"PackSize\":200,\"IsCytotoxic\":false,\"Authorized\":2,\"TSAuthorized\":\"0001-01-01T00:00:00Z\",\"ShelfLife\":1,\"Description\":\"white to off-white round AL 100\",\"UsePrintingDrugName\":false,\"PrintingDrugName\":\"\",\"PharmacyId\":\"6840d2a408efed0f0c610cb4\",\"Route\":{\"Code\":\"PO\",\"Description\":\"Oral\"},\"OriginValues\":\"{\\"Authorized\\":0,\\"ShelfLife\\":0,\\"Route\\":null}\",\"Usage\":4,\"DrugFullName\":\"ALLOPURINOL (APOTEX) 100mg TAB\",\"MedicationFullDetails\":\"ALLOPURINOL (APOTEX) 100mg TAB - ALLOPURINOL (ALLO22)\",\"Id\":\"5f0e69e0a0ba5db368a176b7\",\"CreatedDate\":\"2020-07-15T02:28:47.221Z\",\"CreatedUserId\":\"5e7457052a22160c3cf31edb\",\"LastUpdateUserId\":\"684645e0af648e0d7c18cb9c\",\"LastUpdateDate\":\"2025-10-28T03:15:19.5433999Z\",\"UpdateDeletedDate\":\"1900-01-01T00:00:00Z\",\"IsDeleted\":false}"));
"en-US""en-US"An exception occurred during performance of the job.
An error occurred while serializing the Drug property of class OI.Domain.Prescription: Exception of type 'System.OutOfMemoryException' was thrown.
MongoDB.Bson.BsonSerializationException: An error occurred while serializing the Drug property of class OI.Domain.Prescription: Exception of type 'System.OutOfMemoryException' was thrown. ---> System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown. at MongoDB.Bson.IO.BsonDocumentWriter.WriteStartDocument() at MongoDB.Bson.Serialization.BsonClassMapSerializer`1.SerializeClass(BsonSerializationContext context, BsonSerializationArgs args, TClass document) at MongoDB.Bson.Serialization.BsonClassMapSerializer`1.Serialize(BsonSerializationContext context, BsonSerializationArgs args, TClass value) at MongoDB.Bson.Serialization.Serializers.SerializerBase`1.MongoDB.Bson.Serialization.IBsonSerializer.Serialize(BsonSerializationContext context, BsonSerializationArgs args, Object value) at MongoDB.Bson.Serialization.IBsonSerializerExtensions.Serialize(IBsonSerializer serializer, BsonSerializationContext context, Object value) at MongoDB.Bson.Serialization.BsonClassMapSerializer`1.SerializeNormalMember(BsonSerializationContext context, Object obj, BsonMemberMap memberMap) at MongoDB.Bson.Serialization.BsonClassMapSerializer`1.SerializeMember(BsonSerializationContext context, Object obj, BsonMemberMap memberMap) --- End of inner exception stack trace --- at MongoDB.Bson.Serialization.BsonClassMapSerializer`1.SerializeMember(BsonSerializationContext context, Object obj, BsonMemberMap memberMap) at MongoDB.Bson.Serialization.BsonClassMapSerializer`1.SerializeClass(BsonSerializationContext context, BsonSerializationArgs args, TClass document) at MongoDB.Bson.Serialization.BsonClassMapSerializer`1.Serialize(BsonSerializationContext context, BsonSerializationArgs args, TClass value) at MongoDB.Bson.Serialization.IBsonSerializerExtensions.Serialize[TValue](IBsonSerializer`1 serializer, BsonSerializationContext context, TValue value) at MongoDB.Bson.Serialization.Serializers.EnumerableSerializerBase`2.Serialize(BsonSerializationContext context, BsonSerializationArgs args, TValue value) at MongoDB.Bson.Serialization.IBsonSerializerExtensions.Serialize[TValue](IBsonSerializer`1 serializer, BsonSerializationContext context, TValue value) at MongoDB.Driver.OperatorUpdateDefinition`2.Render(IBsonSerializer`1 documentSerializer, IBsonSerializerRegistry serializerRegistry, LinqProvider linqProvider) at MongoDB.Driver.MongoCollectionImpl`1.ConvertWriteModelToWriteRequest(WriteModel`1 model, Int32 index) at System.Linq.Enumerable.<SelectIterator>d__5`2.MoveNext() at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection) at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source) at MongoDB.Driver.Core.Operations.BulkMixedWriteOperation..ctor(CollectionNamespace collectionNamespace, IEnumerable`1 requests, MessageEncoderSettings messageEncoderSettings) at MongoDB.Driver.MongoCollectionImpl`1.CreateBulkWriteOperation(IClientSessionHandle session, IEnumerable`1 requests, BulkWriteOptions options) at MongoDB.Driver.MongoCollectionImpl`1.<BulkWriteAsync>d__31.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at MongoDB.Driver.MongoCollectionImpl`1.<UsingImplicitSessionAsync>d__107`1.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult() at OI.Data.MongoDBRepository`1.<BulkWriteAsync>d__15.MoveNext() in C:\Program Files (x86)\Jenkins\workspace\myPak-webjob-live\OI\OI.Data\MongoDBRepository.cs:line 166 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter.GetResult() at OI.Service.HangfireTask.PackingFoilTask.<BulkUpdate>d__7.MoveNext() in C:\Program Files (x86)\Jenkins\workspace\myPak-webjob-live\OI\OI.Service\HangfireTask\PackingFoil\PackingFoilTask.cs:line 89 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter.GetResult() at OI.Service.HangfireTask.PackingFoilTask.<ExecuteUpdateDrug>d__6.MoveNext() in C:\Program Files (x86)\Jenkins\workspace\myPak-webjob-live\OI\OI.Service\HangfireTask\PackingFoil\PackingFoilTask.cs:line 69