/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements.  See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License.  You may obtain a copy of the License at
*
*     http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

    package com.ywt.gapi.medicalrecord;

import org.apache.dubbo.common.stream.StreamObserver;
import org.apache.dubbo.common.URL;
import org.apache.dubbo.rpc.Invoker;
import org.apache.dubbo.rpc.PathResolver;
import org.apache.dubbo.rpc.RpcException;
import org.apache.dubbo.rpc.ServerService;
import org.apache.dubbo.rpc.TriRpcStatus;
import org.apache.dubbo.rpc.model.MethodDescriptor;
import org.apache.dubbo.rpc.model.ServiceDescriptor;
import org.apache.dubbo.rpc.model.StubMethodDescriptor;
import org.apache.dubbo.rpc.model.StubServiceDescriptor;
import org.apache.dubbo.rpc.stub.BiStreamMethodHandler;
import org.apache.dubbo.rpc.stub.ServerStreamMethodHandler;
import org.apache.dubbo.rpc.stub.StubInvocationUtil;
import org.apache.dubbo.rpc.stub.StubInvoker;
import org.apache.dubbo.rpc.stub.StubMethodHandler;
import org.apache.dubbo.rpc.stub.StubSuppliers;
import org.apache.dubbo.rpc.stub.UnaryStubMethodHandler;

import com.google.protobuf.Message;

import java.util.HashMap;
import java.util.Map;
import java.util.function.BiConsumer;
import java.util.concurrent.CompletableFuture;

public final class DubboMedicalRecordServiceTriple {

    public static final String SERVICE_NAME = MedicalRecordService.SERVICE_NAME;

    private static final StubServiceDescriptor serviceDescriptor = new StubServiceDescriptor(SERVICE_NAME,MedicalRecordService.class);

    static {
        org.apache.dubbo.rpc.protocol.tri.service.SchemaDescriptorRegistry.addSchemaDescriptor(SERVICE_NAME,MedicalrecordProto.getDescriptor());
        StubSuppliers.addSupplier(SERVICE_NAME, DubboMedicalRecordServiceTriple::newStub);
        StubSuppliers.addSupplier(MedicalRecordService.JAVA_SERVICE_NAME,  DubboMedicalRecordServiceTriple::newStub);
        StubSuppliers.addDescriptor(SERVICE_NAME, serviceDescriptor);
        StubSuppliers.addDescriptor(MedicalRecordService.JAVA_SERVICE_NAME, serviceDescriptor);
    }

    @SuppressWarnings("all")
    public static MedicalRecordService newStub(Invoker<?> invoker) {
        return new MedicalRecordServiceStub((Invoker<MedicalRecordService>)invoker);
    }

    /**
         * <pre>
         * 检查报告单id
         * </pre>
         */
    private static final StubMethodDescriptor getMedicalRecordByIdMethod = new StubMethodDescriptor("getMedicalRecordById",
    com.ywt.gapi.medicalrecord.GetMedicalRecordByIdRequest.class, com.ywt.gapi.medicalrecord.GetMedicalRecordByIdResponse.class, serviceDescriptor, MethodDescriptor.RpcType.UNARY,
    obj -> ((Message) obj).toByteArray(), obj -> ((Message) obj).toByteArray(), com.ywt.gapi.medicalrecord.GetMedicalRecordByIdRequest::parseFrom,
    com.ywt.gapi.medicalrecord.GetMedicalRecordByIdResponse::parseFrom);

    private static final StubMethodDescriptor getMedicalRecordByIdAsyncMethod = new StubMethodDescriptor("getMedicalRecordById",
    com.ywt.gapi.medicalrecord.GetMedicalRecordByIdRequest.class, java.util.concurrent.CompletableFuture.class, serviceDescriptor, MethodDescriptor.RpcType.UNARY,
    obj -> ((Message) obj).toByteArray(), obj -> ((Message) obj).toByteArray(), com.ywt.gapi.medicalrecord.GetMedicalRecordByIdRequest::parseFrom,
    com.ywt.gapi.medicalrecord.GetMedicalRecordByIdResponse::parseFrom);

    private static final StubMethodDescriptor getMedicalRecordByIdProxyAsyncMethod = new StubMethodDescriptor("getMedicalRecordByIdAsync",
    com.ywt.gapi.medicalrecord.GetMedicalRecordByIdRequest.class, com.ywt.gapi.medicalrecord.GetMedicalRecordByIdResponse.class, serviceDescriptor, MethodDescriptor.RpcType.UNARY,
    obj -> ((Message) obj).toByteArray(), obj -> ((Message) obj).toByteArray(), com.ywt.gapi.medicalrecord.GetMedicalRecordByIdRequest::parseFrom,
    com.ywt.gapi.medicalrecord.GetMedicalRecordByIdResponse::parseFrom);

    /**
         * <pre>
         * 检查报告单标题名称
         * </pre>
         */
    private static final StubMethodDescriptor getOutpatientRecordListMethod = new StubMethodDescriptor("getOutpatientRecordList",
    com.ywt.gapi.medicalrecord.GetOutpatientRecordListRequest.class, com.ywt.gapi.medicalrecord.GetOutpatientRecordListResponse.class, serviceDescriptor, MethodDescriptor.RpcType.UNARY,
    obj -> ((Message) obj).toByteArray(), obj -> ((Message) obj).toByteArray(), com.ywt.gapi.medicalrecord.GetOutpatientRecordListRequest::parseFrom,
    com.ywt.gapi.medicalrecord.GetOutpatientRecordListResponse::parseFrom);

    private static final StubMethodDescriptor getOutpatientRecordListAsyncMethod = new StubMethodDescriptor("getOutpatientRecordList",
    com.ywt.gapi.medicalrecord.GetOutpatientRecordListRequest.class, java.util.concurrent.CompletableFuture.class, serviceDescriptor, MethodDescriptor.RpcType.UNARY,
    obj -> ((Message) obj).toByteArray(), obj -> ((Message) obj).toByteArray(), com.ywt.gapi.medicalrecord.GetOutpatientRecordListRequest::parseFrom,
    com.ywt.gapi.medicalrecord.GetOutpatientRecordListResponse::parseFrom);

    private static final StubMethodDescriptor getOutpatientRecordListProxyAsyncMethod = new StubMethodDescriptor("getOutpatientRecordListAsync",
    com.ywt.gapi.medicalrecord.GetOutpatientRecordListRequest.class, com.ywt.gapi.medicalrecord.GetOutpatientRecordListResponse.class, serviceDescriptor, MethodDescriptor.RpcType.UNARY,
    obj -> ((Message) obj).toByteArray(), obj -> ((Message) obj).toByteArray(), com.ywt.gapi.medicalrecord.GetOutpatientRecordListRequest::parseFrom,
    com.ywt.gapi.medicalrecord.GetOutpatientRecordListResponse::parseFrom);

    /**
         * <pre>
         * 检查报告单审核日期（YYYY-MM-DD HH:MM:SS）
         * </pre>
         */
    private static final StubMethodDescriptor syncReportMethod = new StubMethodDescriptor("syncReport",
    com.ywt.gapi.medicalrecord.SyncReportRequest.class, com.ywt.gapi.Result.class, serviceDescriptor, MethodDescriptor.RpcType.UNARY,
    obj -> ((Message) obj).toByteArray(), obj -> ((Message) obj).toByteArray(), com.ywt.gapi.medicalrecord.SyncReportRequest::parseFrom,
    com.ywt.gapi.Result::parseFrom);

    private static final StubMethodDescriptor syncReportAsyncMethod = new StubMethodDescriptor("syncReport",
    com.ywt.gapi.medicalrecord.SyncReportRequest.class, java.util.concurrent.CompletableFuture.class, serviceDescriptor, MethodDescriptor.RpcType.UNARY,
    obj -> ((Message) obj).toByteArray(), obj -> ((Message) obj).toByteArray(), com.ywt.gapi.medicalrecord.SyncReportRequest::parseFrom,
    com.ywt.gapi.Result::parseFrom);

    private static final StubMethodDescriptor syncReportProxyAsyncMethod = new StubMethodDescriptor("syncReportAsync",
    com.ywt.gapi.medicalrecord.SyncReportRequest.class, com.ywt.gapi.Result.class, serviceDescriptor, MethodDescriptor.RpcType.UNARY,
    obj -> ((Message) obj).toByteArray(), obj -> ((Message) obj).toByteArray(), com.ywt.gapi.medicalrecord.SyncReportRequest::parseFrom,
    com.ywt.gapi.Result::parseFrom);

    /**
         * <pre>
         * 报告状态 0 未审核 1已审核
         * </pre>
         */
    private static final StubMethodDescriptor getOutpatientRecordListByHisPatientIdMethod = new StubMethodDescriptor("getOutpatientRecordListByHisPatientId",
    com.ywt.gapi.medicalrecord.GetOutpatientRecordListByHisPatientIdRequest.class, com.ywt.gapi.medicalrecord.GetOutpatientRecordListByHisPatientIdResponse.class, serviceDescriptor, MethodDescriptor.RpcType.UNARY,
    obj -> ((Message) obj).toByteArray(), obj -> ((Message) obj).toByteArray(), com.ywt.gapi.medicalrecord.GetOutpatientRecordListByHisPatientIdRequest::parseFrom,
    com.ywt.gapi.medicalrecord.GetOutpatientRecordListByHisPatientIdResponse::parseFrom);

    private static final StubMethodDescriptor getOutpatientRecordListByHisPatientIdAsyncMethod = new StubMethodDescriptor("getOutpatientRecordListByHisPatientId",
    com.ywt.gapi.medicalrecord.GetOutpatientRecordListByHisPatientIdRequest.class, java.util.concurrent.CompletableFuture.class, serviceDescriptor, MethodDescriptor.RpcType.UNARY,
    obj -> ((Message) obj).toByteArray(), obj -> ((Message) obj).toByteArray(), com.ywt.gapi.medicalrecord.GetOutpatientRecordListByHisPatientIdRequest::parseFrom,
    com.ywt.gapi.medicalrecord.GetOutpatientRecordListByHisPatientIdResponse::parseFrom);

    private static final StubMethodDescriptor getOutpatientRecordListByHisPatientIdProxyAsyncMethod = new StubMethodDescriptor("getOutpatientRecordListByHisPatientIdAsync",
    com.ywt.gapi.medicalrecord.GetOutpatientRecordListByHisPatientIdRequest.class, com.ywt.gapi.medicalrecord.GetOutpatientRecordListByHisPatientIdResponse.class, serviceDescriptor, MethodDescriptor.RpcType.UNARY,
    obj -> ((Message) obj).toByteArray(), obj -> ((Message) obj).toByteArray(), com.ywt.gapi.medicalrecord.GetOutpatientRecordListByHisPatientIdRequest::parseFrom,
    com.ywt.gapi.medicalrecord.GetOutpatientRecordListByHisPatientIdResponse::parseFrom);

    /**
         * <pre>
         * 患者姓名
         * </pre>
         */
    private static final StubMethodDescriptor deleteMedicalRecordTemplateMethod = new StubMethodDescriptor("deleteMedicalRecordTemplate",
    com.ywt.gapi.medicalrecord.DeleteMedicalRecordTemplateRequest.class, com.ywt.gapi.medicalrecord.DeleteMedicalRecordTemplateResponse.class, serviceDescriptor, MethodDescriptor.RpcType.UNARY,
    obj -> ((Message) obj).toByteArray(), obj -> ((Message) obj).toByteArray(), com.ywt.gapi.medicalrecord.DeleteMedicalRecordTemplateRequest::parseFrom,
    com.ywt.gapi.medicalrecord.DeleteMedicalRecordTemplateResponse::parseFrom);

    private static final StubMethodDescriptor deleteMedicalRecordTemplateAsyncMethod = new StubMethodDescriptor("deleteMedicalRecordTemplate",
    com.ywt.gapi.medicalrecord.DeleteMedicalRecordTemplateRequest.class, java.util.concurrent.CompletableFuture.class, serviceDescriptor, MethodDescriptor.RpcType.UNARY,
    obj -> ((Message) obj).toByteArray(), obj -> ((Message) obj).toByteArray(), com.ywt.gapi.medicalrecord.DeleteMedicalRecordTemplateRequest::parseFrom,
    com.ywt.gapi.medicalrecord.DeleteMedicalRecordTemplateResponse::parseFrom);

    private static final StubMethodDescriptor deleteMedicalRecordTemplateProxyAsyncMethod = new StubMethodDescriptor("deleteMedicalRecordTemplateAsync",
    com.ywt.gapi.medicalrecord.DeleteMedicalRecordTemplateRequest.class, com.ywt.gapi.medicalrecord.DeleteMedicalRecordTemplateResponse.class, serviceDescriptor, MethodDescriptor.RpcType.UNARY,
    obj -> ((Message) obj).toByteArray(), obj -> ((Message) obj).toByteArray(), com.ywt.gapi.medicalrecord.DeleteMedicalRecordTemplateRequest::parseFrom,
    com.ywt.gapi.medicalrecord.DeleteMedicalRecordTemplateResponse::parseFrom);





    public static class MedicalRecordServiceStub implements MedicalRecordService{
        private final Invoker<MedicalRecordService> invoker;

        public MedicalRecordServiceStub(Invoker<MedicalRecordService> invoker) {
            this.invoker = invoker;
        }

            /**
         * <pre>
         * 检查报告单id
         * </pre>
         */
        @Override
        public com.ywt.gapi.medicalrecord.GetMedicalRecordByIdResponse getMedicalRecordById(com.ywt.gapi.medicalrecord.GetMedicalRecordByIdRequest request){
            return StubInvocationUtil.unaryCall(invoker, getMedicalRecordByIdMethod, request);
        }

        public CompletableFuture<com.ywt.gapi.medicalrecord.GetMedicalRecordByIdResponse> getMedicalRecordByIdAsync(com.ywt.gapi.medicalrecord.GetMedicalRecordByIdRequest request){
            return StubInvocationUtil.unaryCall(invoker, getMedicalRecordByIdAsyncMethod, request);
        }

            /**
         * <pre>
         * 检查报告单id
         * </pre>
         */
        @Override
        public void getMedicalRecordById(com.ywt.gapi.medicalrecord.GetMedicalRecordByIdRequest request, StreamObserver<com.ywt.gapi.medicalrecord.GetMedicalRecordByIdResponse> responseObserver){
            StubInvocationUtil.unaryCall(invoker, getMedicalRecordByIdMethod , request, responseObserver);
        }
            /**
         * <pre>
         * 检查报告单标题名称
         * </pre>
         */
        @Override
        public com.ywt.gapi.medicalrecord.GetOutpatientRecordListResponse getOutpatientRecordList(com.ywt.gapi.medicalrecord.GetOutpatientRecordListRequest request){
            return StubInvocationUtil.unaryCall(invoker, getOutpatientRecordListMethod, request);
        }

        public CompletableFuture<com.ywt.gapi.medicalrecord.GetOutpatientRecordListResponse> getOutpatientRecordListAsync(com.ywt.gapi.medicalrecord.GetOutpatientRecordListRequest request){
            return StubInvocationUtil.unaryCall(invoker, getOutpatientRecordListAsyncMethod, request);
        }

            /**
         * <pre>
         * 检查报告单标题名称
         * </pre>
         */
        @Override
        public void getOutpatientRecordList(com.ywt.gapi.medicalrecord.GetOutpatientRecordListRequest request, StreamObserver<com.ywt.gapi.medicalrecord.GetOutpatientRecordListResponse> responseObserver){
            StubInvocationUtil.unaryCall(invoker, getOutpatientRecordListMethod , request, responseObserver);
        }
            /**
         * <pre>
         * 检查报告单审核日期（YYYY-MM-DD HH:MM:SS）
         * </pre>
         */
        @Override
        public com.ywt.gapi.Result syncReport(com.ywt.gapi.medicalrecord.SyncReportRequest request){
            return StubInvocationUtil.unaryCall(invoker, syncReportMethod, request);
        }

        public CompletableFuture<com.ywt.gapi.Result> syncReportAsync(com.ywt.gapi.medicalrecord.SyncReportRequest request){
            return StubInvocationUtil.unaryCall(invoker, syncReportAsyncMethod, request);
        }

            /**
         * <pre>
         * 检查报告单审核日期（YYYY-MM-DD HH:MM:SS）
         * </pre>
         */
        @Override
        public void syncReport(com.ywt.gapi.medicalrecord.SyncReportRequest request, StreamObserver<com.ywt.gapi.Result> responseObserver){
            StubInvocationUtil.unaryCall(invoker, syncReportMethod , request, responseObserver);
        }
            /**
         * <pre>
         * 报告状态 0 未审核 1已审核
         * </pre>
         */
        @Override
        public com.ywt.gapi.medicalrecord.GetOutpatientRecordListByHisPatientIdResponse getOutpatientRecordListByHisPatientId(com.ywt.gapi.medicalrecord.GetOutpatientRecordListByHisPatientIdRequest request){
            return StubInvocationUtil.unaryCall(invoker, getOutpatientRecordListByHisPatientIdMethod, request);
        }

        public CompletableFuture<com.ywt.gapi.medicalrecord.GetOutpatientRecordListByHisPatientIdResponse> getOutpatientRecordListByHisPatientIdAsync(com.ywt.gapi.medicalrecord.GetOutpatientRecordListByHisPatientIdRequest request){
            return StubInvocationUtil.unaryCall(invoker, getOutpatientRecordListByHisPatientIdAsyncMethod, request);
        }

            /**
         * <pre>
         * 报告状态 0 未审核 1已审核
         * </pre>
         */
        @Override
        public void getOutpatientRecordListByHisPatientId(com.ywt.gapi.medicalrecord.GetOutpatientRecordListByHisPatientIdRequest request, StreamObserver<com.ywt.gapi.medicalrecord.GetOutpatientRecordListByHisPatientIdResponse> responseObserver){
            StubInvocationUtil.unaryCall(invoker, getOutpatientRecordListByHisPatientIdMethod , request, responseObserver);
        }
            /**
         * <pre>
         * 患者姓名
         * </pre>
         */
        @Override
        public com.ywt.gapi.medicalrecord.DeleteMedicalRecordTemplateResponse deleteMedicalRecordTemplate(com.ywt.gapi.medicalrecord.DeleteMedicalRecordTemplateRequest request){
            return StubInvocationUtil.unaryCall(invoker, deleteMedicalRecordTemplateMethod, request);
        }

        public CompletableFuture<com.ywt.gapi.medicalrecord.DeleteMedicalRecordTemplateResponse> deleteMedicalRecordTemplateAsync(com.ywt.gapi.medicalrecord.DeleteMedicalRecordTemplateRequest request){
            return StubInvocationUtil.unaryCall(invoker, deleteMedicalRecordTemplateAsyncMethod, request);
        }

            /**
         * <pre>
         * 患者姓名
         * </pre>
         */
        @Override
        public void deleteMedicalRecordTemplate(com.ywt.gapi.medicalrecord.DeleteMedicalRecordTemplateRequest request, StreamObserver<com.ywt.gapi.medicalrecord.DeleteMedicalRecordTemplateResponse> responseObserver){
            StubInvocationUtil.unaryCall(invoker, deleteMedicalRecordTemplateMethod , request, responseObserver);
        }



    }

    public static abstract class MedicalRecordServiceImplBase implements MedicalRecordService, ServerService<MedicalRecordService> {

        private <T, R> BiConsumer<T, StreamObserver<R>> syncToAsync(java.util.function.Function<T, R> syncFun) {
            return new BiConsumer<T, StreamObserver<R>>() {
                @Override
                public void accept(T t, StreamObserver<R> observer) {
                    try {
                        R ret = syncFun.apply(t);
                        observer.onNext(ret);
                        observer.onCompleted();
                    } catch (Throwable e) {
                        observer.onError(e);
                    }
                }
            };
        }

        @Override
        public final Invoker<MedicalRecordService> getInvoker(URL url) {
            PathResolver pathResolver = url.getOrDefaultFrameworkModel()
            .getExtensionLoader(PathResolver.class)
            .getDefaultExtension();
            Map<String,StubMethodHandler<?, ?>> handlers = new HashMap<>();

            pathResolver.addNativeStub( "/" + SERVICE_NAME + "/getMedicalRecordById" );
            pathResolver.addNativeStub( "/" + SERVICE_NAME + "/getMedicalRecordByIdAsync" );
            pathResolver.addNativeStub( "/" + SERVICE_NAME + "/getOutpatientRecordList" );
            pathResolver.addNativeStub( "/" + SERVICE_NAME + "/getOutpatientRecordListAsync" );
            pathResolver.addNativeStub( "/" + SERVICE_NAME + "/syncReport" );
            pathResolver.addNativeStub( "/" + SERVICE_NAME + "/syncReportAsync" );
            pathResolver.addNativeStub( "/" + SERVICE_NAME + "/getOutpatientRecordListByHisPatientId" );
            pathResolver.addNativeStub( "/" + SERVICE_NAME + "/getOutpatientRecordListByHisPatientIdAsync" );
            pathResolver.addNativeStub( "/" + SERVICE_NAME + "/deleteMedicalRecordTemplate" );
            pathResolver.addNativeStub( "/" + SERVICE_NAME + "/deleteMedicalRecordTemplateAsync" );

            BiConsumer<com.ywt.gapi.medicalrecord.GetMedicalRecordByIdRequest, StreamObserver<com.ywt.gapi.medicalrecord.GetMedicalRecordByIdResponse>> getMedicalRecordByIdFunc = this::getMedicalRecordById;
            handlers.put(getMedicalRecordByIdMethod.getMethodName(), new UnaryStubMethodHandler<>(getMedicalRecordByIdFunc));
            BiConsumer<com.ywt.gapi.medicalrecord.GetMedicalRecordByIdRequest, StreamObserver<com.ywt.gapi.medicalrecord.GetMedicalRecordByIdResponse>> getMedicalRecordByIdAsyncFunc = syncToAsync(this::getMedicalRecordById);
            handlers.put(getMedicalRecordByIdProxyAsyncMethod.getMethodName(), new UnaryStubMethodHandler<>(getMedicalRecordByIdAsyncFunc));
            BiConsumer<com.ywt.gapi.medicalrecord.GetOutpatientRecordListRequest, StreamObserver<com.ywt.gapi.medicalrecord.GetOutpatientRecordListResponse>> getOutpatientRecordListFunc = this::getOutpatientRecordList;
            handlers.put(getOutpatientRecordListMethod.getMethodName(), new UnaryStubMethodHandler<>(getOutpatientRecordListFunc));
            BiConsumer<com.ywt.gapi.medicalrecord.GetOutpatientRecordListRequest, StreamObserver<com.ywt.gapi.medicalrecord.GetOutpatientRecordListResponse>> getOutpatientRecordListAsyncFunc = syncToAsync(this::getOutpatientRecordList);
            handlers.put(getOutpatientRecordListProxyAsyncMethod.getMethodName(), new UnaryStubMethodHandler<>(getOutpatientRecordListAsyncFunc));
            BiConsumer<com.ywt.gapi.medicalrecord.SyncReportRequest, StreamObserver<com.ywt.gapi.Result>> syncReportFunc = this::syncReport;
            handlers.put(syncReportMethod.getMethodName(), new UnaryStubMethodHandler<>(syncReportFunc));
            BiConsumer<com.ywt.gapi.medicalrecord.SyncReportRequest, StreamObserver<com.ywt.gapi.Result>> syncReportAsyncFunc = syncToAsync(this::syncReport);
            handlers.put(syncReportProxyAsyncMethod.getMethodName(), new UnaryStubMethodHandler<>(syncReportAsyncFunc));
            BiConsumer<com.ywt.gapi.medicalrecord.GetOutpatientRecordListByHisPatientIdRequest, StreamObserver<com.ywt.gapi.medicalrecord.GetOutpatientRecordListByHisPatientIdResponse>> getOutpatientRecordListByHisPatientIdFunc = this::getOutpatientRecordListByHisPatientId;
            handlers.put(getOutpatientRecordListByHisPatientIdMethod.getMethodName(), new UnaryStubMethodHandler<>(getOutpatientRecordListByHisPatientIdFunc));
            BiConsumer<com.ywt.gapi.medicalrecord.GetOutpatientRecordListByHisPatientIdRequest, StreamObserver<com.ywt.gapi.medicalrecord.GetOutpatientRecordListByHisPatientIdResponse>> getOutpatientRecordListByHisPatientIdAsyncFunc = syncToAsync(this::getOutpatientRecordListByHisPatientId);
            handlers.put(getOutpatientRecordListByHisPatientIdProxyAsyncMethod.getMethodName(), new UnaryStubMethodHandler<>(getOutpatientRecordListByHisPatientIdAsyncFunc));
            BiConsumer<com.ywt.gapi.medicalrecord.DeleteMedicalRecordTemplateRequest, StreamObserver<com.ywt.gapi.medicalrecord.DeleteMedicalRecordTemplateResponse>> deleteMedicalRecordTemplateFunc = this::deleteMedicalRecordTemplate;
            handlers.put(deleteMedicalRecordTemplateMethod.getMethodName(), new UnaryStubMethodHandler<>(deleteMedicalRecordTemplateFunc));
            BiConsumer<com.ywt.gapi.medicalrecord.DeleteMedicalRecordTemplateRequest, StreamObserver<com.ywt.gapi.medicalrecord.DeleteMedicalRecordTemplateResponse>> deleteMedicalRecordTemplateAsyncFunc = syncToAsync(this::deleteMedicalRecordTemplate);
            handlers.put(deleteMedicalRecordTemplateProxyAsyncMethod.getMethodName(), new UnaryStubMethodHandler<>(deleteMedicalRecordTemplateAsyncFunc));




            return new StubInvoker<>(this, url, MedicalRecordService.class, handlers);
        }


        @Override
        public com.ywt.gapi.medicalrecord.GetMedicalRecordByIdResponse getMedicalRecordById(com.ywt.gapi.medicalrecord.GetMedicalRecordByIdRequest request){
            throw unimplementedMethodException(getMedicalRecordByIdMethod);
        }

        @Override
        public com.ywt.gapi.medicalrecord.GetOutpatientRecordListResponse getOutpatientRecordList(com.ywt.gapi.medicalrecord.GetOutpatientRecordListRequest request){
            throw unimplementedMethodException(getOutpatientRecordListMethod);
        }

        @Override
        public com.ywt.gapi.Result syncReport(com.ywt.gapi.medicalrecord.SyncReportRequest request){
            throw unimplementedMethodException(syncReportMethod);
        }

        @Override
        public com.ywt.gapi.medicalrecord.GetOutpatientRecordListByHisPatientIdResponse getOutpatientRecordListByHisPatientId(com.ywt.gapi.medicalrecord.GetOutpatientRecordListByHisPatientIdRequest request){
            throw unimplementedMethodException(getOutpatientRecordListByHisPatientIdMethod);
        }

        @Override
        public com.ywt.gapi.medicalrecord.DeleteMedicalRecordTemplateResponse deleteMedicalRecordTemplate(com.ywt.gapi.medicalrecord.DeleteMedicalRecordTemplateRequest request){
            throw unimplementedMethodException(deleteMedicalRecordTemplateMethod);
        }





        @Override
        public final ServiceDescriptor getServiceDescriptor() {
            return serviceDescriptor;
        }
        private RpcException unimplementedMethodException(StubMethodDescriptor methodDescriptor) {
            return TriRpcStatus.UNIMPLEMENTED.withDescription(String.format("Method %s is unimplemented",
                "/" + serviceDescriptor.getInterfaceName() + "/" + methodDescriptor.getMethodName())).asException();
        }
    }

}
